版主太强大了,多日来困扰我:Q 的问题终于得到解决了:lol !~
万份感谢!!!:handshake
vincent_xox
-
关于继承问题 -
关于继承问题由于公司需要,我需要在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!!! -
修改模块partner后不能登陆openerp[quote]原帖由 [i]oldrev[/i] 于 2009-6-13 19:37 发表 www.shine-it.net/redirect.php?goto=findpost&pid=2225&ptid=511
不要直接修改内置模块,应该新建一个模块并继承内置模块中的对象 [/quote]具体是怎样做呢?可以发个例子看看吗?
-
修改模块partner后不能登陆openerp我在模块partner.py里增加了一些属性,
内容如下:
'historydetail':fields.text('History Detail'),
'memo':fields.text('Memo'),
'sourcememo': fields.char('Source Memo',size=64),
'vatmemo': fields.char('VAT Memo',size=64),
'retail': fields.boolean('Retail'),
'architect': fields.boolean('Architect'),
'upholsterer': fields.boolean('Uphlsterer'),
'retailsend': fields.boolean('Retail Send'),
'architectsend': fields.boolean('Architect Send'),
'upholsterersend': fields.boolean('Uphlsterer Send'),
'logo':fields.binary('Logo'),
'2ndemail':fields.char('2nd e-mail'),只修改了属性,计划修改后在OpenERP客户端更新模块,再修改view得到所增加的属性
但是修改后竟然登陆不了openerp,openerp-server.log里相应的信息如下:
[2009-06-13 17:08:16,733] INFO:dbpool:Connecting to template1
[2009-06-13 17:08:17,717] INFO:dbpool:Closing all connections to template1
[2009-06-13 17:08:50,655] INFO:init:module base: loading objects
[2009-06-13 17:08:50,655] INFO:init:module base: registering objects
[2009-06-13 17:08:50,671] CRITICAL:init:Couldn't load module basef
[2009-06-13 17:08:50,671] CRITICAL:init:init() takes exactly 3 arguments (2 given)由于本人是初学者,对Python了解不多,请问大侠们给点意见,共同学习一下!
Any help would be appreciated!!![[i] 本帖最后由 vincent_xox 于 2009-6-13 17:21 编辑 [/i]]