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

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

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

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

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

Inherit



  • 有两个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()
    

Log in to reply