Odoo中文社区可以通过以下三个域名访问:shine-it.net , odoocn.org,odoo.net.cn

原论坛用户的基本信息和发帖这里都予以保留,请注意:原论坛用户无需重新注册新用户,但是您的密码需要重置

开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号

如果您登录系统碰到问题,请在微信公众号留言:

关于继承问题



  • 由于公司需要,我需要在Order Line加几个属性,于是我新建了一个模块saleorderline,下面是我写的py文件

    init.py
    [code]import saleorderline[/code]

    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/python

    from 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!!!



  • 由于公司需要,我需要在Order Line加几个属性,于是我新建了一个模块saleorderline,下面是我写的py文件

    init.py
    [code]import saleorderline[/code]

    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/python

    from 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


登录后回复
 

与 Odoo 中文社区 的连接断开,我们正在尝试重连,请耐心等待