跳转至内容
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(Flatly)
  • 不使用皮肤
折叠

Odoo 中文社区

  1. 主页
  2. 版块
  3. Odoo 开发与实施交流
  4. Inherit

Inherit

已定时 已固定 已锁定 已移动 Odoo 开发与实施交流
2 帖子 1 发布者 2.4k 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • X 离线
    X 离线
    xianliu
    写于 最后由 编辑
    #1

    有两个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

    • 登录

    • 没有帐号? 注册

    • 登录或注册以进行搜索。
    • 第一个帖子
      最后一个帖子
    0
    • 版块
    • 标签
    • 热门
    • 用户
    • 群组