---
title: "oe6.1.1 安装模块 product_links(6.0版)，抛出no attribute 'external_osv' 解决方案"
author: "xiao"
date: "2012-10-26T14:01:36Z"
tags: []
categories: ["互联网"]
slug: "oe6-1-1-product-links-6-0-no-attribute-external-osv"
draft: false
lastmod: "2012-10-26T14:02:16Z"
id: 1705934
url: "https://xiao.iteye.com/blog/1705934"
---

## 抛出错误

AttributeError: 'module' object has no attribute 'external\_osv'

 

## 原因

product\_links 继承了 base\_external\_referentials模块的 external\_osv类。

base\_external\_referentials模块6.0版，有一个external\_osv类

 

```
class external_osv(osv.osv):
    pass #FIXME remove! only here for compatibility purpose for now
```

但安装是6.1版，已经去掉了这个类

 

 

## 解决方案

修改product\_links.py文件。

原代码（部分）

 

```
from osv import fields, osv
from base_external_referentials import external_osv

class product_link(external_osv.external_osv):
    _name = 'product.link'
    _rec_name = 'linked_product_id'
```

 

修改成

 

```
from osv import fields, osv
#from base_external_referentials import external_osv

#class product_link(external_osv.external_osv):
class product_link(osv.osv):
    _name = 'product.link'
    _rec_name = 'linked_product_id'
```