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

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

开发人员可以登录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()