Odoo 中文社区

    • 注册
    • 登录
    • 搜索
    • 版块
    • 标签
    • 热门
    • 用户
    • 群组

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

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

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

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

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

    Inherit

    Odoo 开发与实施交流
    1
    2
    2310
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • X
      xianliu 最后由 编辑

      有两个CLASS,第2个继承第1个的对象[color=red]service.type[/color],但是第2个对象未在数据库中创建,是什么原因?_table如果加上是OK的,这里就有另外一个问题了,_name与_table相同时是可以省略的,这里为什么不给省略?

      class eservice_type(osv.osv):&nbsp; &nbsp; <br />&nbsp;  _name = &#039;service.type&#039;<br />&nbsp; &nbsp; _table = &#039;bn_service_type&#039;&nbsp; &nbsp; <br />&nbsp; &nbsp; _columns= {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &#039;description&#039;:fields.char(&quot;description&quot;, size=240, translate=True, help=&#039;&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; _default={<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;description&#039;:lambda *a:&#039;hello&#039;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />eservice_type()<br /><br />class eservice_bn_lookup_types(osv.osv):<br />&nbsp;  <br />&nbsp; &nbsp; _name = &#039;bn.lookup.types&#039; <br />&nbsp; &nbsp; _inherit = &#039;service.type&#039;<br />&nbsp; &nbsp; _columns={<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &#039;meaning&#039;:fields.char(&quot;meaning&quot;, size=80, translate=True, help=&#039;&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; <br />eservice_bn_lookup_types()
      
      1 条回复 最后回复 回复 引用 0
      • First post
        Last post