Oe6.1.1 安装模块 product_links(6.0版),抛出no attribute 'external_osv' 解决方案
-
[size=18pt]抛出错误[/size]
AttributeError: 'module' object has no attribute 'external_osv'
[size=18pt]原因[/size]
product_links 继承了 base_external_referentials模块的 external_osv类。
base_external_referentials模块6.0版,有一个external_osv类<br />class external_osv(osv.osv):<br /> pass #FIXME remove! only here for compatibility purpose for now<br />
但安装是6.1版,已经去掉了这个类
[size=18pt]解决方案[/size]
修改product_links.py文件。
原代码(部分)<br />from osv import fields, osv<br />from base_external_referentials import external_osv<br /><br />class product_link(external_osv.external_osv):<br /> _name = 'product.link'<br /> _rec_name = 'linked_product_id'<br />
修改成<br />from osv import fields, osv<br />#from base_external_referentials import external_osv<br /><br />#class product_link(external_osv.external_osv):<br />class product_link(osv.osv):<br /> _name = 'product.link'<br /> _rec_name = 'linked_product_id'<br />