Odoo 中文社区

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Popular
    • Users
    • Groups

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

    由于系统升迁的原因,本论坛部分较早期的内容存在格式和链接损坏失效的问题,并非本论坛系统本身的缺陷,望谅解

    本社区没有维护任何QQ群讨论组,任何与本社区同名的QQ群讨论组的言论与本社区无关!

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

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

    关于继承问题

    Odoo 新手求助
    2
    4
    4588
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      vincent_xox last edited by

      由于公司需要,我需要在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/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!!!

      1 Reply Last reply Reply Quote 0
      • digitalsatori
        digitalsatori 管理员 last edited by

        terp.py 中的depend中加 'sale‘ 试试

        【上海先安科技】(tony AT openerp.cn)

        1 Reply Last reply Reply Quote 0
        • V
          vincent_xox last edited by

          版主太强大了,多日来困扰我:Q 的问题终于得到解决了:lol !~
          万份感谢!!!:handshake

          1 Reply Last reply Reply Quote 0
          • First post
            Last post