【发布时间】:2018-01-24 16:11:10
【问题描述】:
我在 res.partner 中有一个名为“代码”的自定义字段:
class cust_partner
_inherit = 'res.partner'
_columns = { 'code': fields.char('Code', index=True), }
自定义 name_get , name_search 方法来获取代码而不是客户名称。
它只适用于搜索并在字段中显示名称
在我的自定义类中:
class test_order(osv.Model):
_inherit = 'test_order'
_columns = {'customer_code': fields.many2one('res.partner', 'Code', ondelete='restrict', required=False), }
我的预期输出在 test_order 类中,我需要在字段 customer_code 中显示“代码”的值而不是名称(保存在表单视图中之后)。
【问题讨论】:
标签: odoo-8