关于继承问题
-
由于公司需要,我需要在Order Line加几个属性,于是我新建了一个模块saleorderline,下面是我写的py文件
init.py
import saleorderline
terp.py
[code]{
"name" : "Order Line Extened Module",
"version" : "1.0",
"depends" : ["base"],
"init_xml" : [],
"update_xml" : [],
"installable" : True,
"active" : False,
}[/code]saleorderline.py
[code]
#!/usr/bin/pythonfrom osv import osv, fields
class sale_order_line(osv.osv):
_name = 'sale.order.line'
_inherit = 'sale.order.line'
_description = 'Sale Order Line'
_columns = {
'sc': fields.char('Serial Code',size=64),
}
sale_order_line()
[/code]OpenERP Client找到了我新写的模块,但是当我在安装(同样在OpenERP Client上安装)的时候,出现了以下错误:
[code]
Traceback (most recent call last):
File "netsvc.pyo", line 235, in dispatch
File "netsvc.pyo", line 74, in call
File "serviceweb_services.pyo", line 582, in execute
File "serviceweb_services.pyo", line 562, in execute
File "wizard__init_.pyo", line 178, in execute
File "wizard__init__.pyo", line 74, in execute_cr
File "d:OpenERP AllInOneServeraddonsbasemodulewizardwizard_module_upgrade.py", line 92, in upgrade_module
File "pooler.pyo", line 62, in restart_pool
File "pooler.pyo", line 40, in get_db_and_pool
File "addons__init_.pyo", line 718, in load_modules
File "addons__init__.pyo", line 579, in load_module_graph
File "osvosv.pyo", line 171, in instanciate
File "osvosv.pyo", line 235, in createInstance
AttributeError: 'NoneType' object has no attribute '_columns'
[/code]大家知道为什么会出现这种错误吗?
在线等,any help would be appreciated!!! -
terp.py 中的depend中加 'sale‘ 试试
-
版主太强大了,多日来困扰我:Q 的问题终于得到解决了:lol !~
万份感谢!!!:handshake