odoo many2one,在视图继续索引?related
作者:互联网
class test_many2one(models.Model): _name = 'test_many2one' users_id = fields.Many2one('hr.employee', string='用户') gender = fields.Selection([ ('male', 'Male'), ('female', 'Female'), ('other', 'Other') ], string='性别', related='users_id.gender')
可以通过多对一的关系,继续所以相关信息
上面的例子,是找到多对一的员工,并在下面显示性别,当然,也可以简写一下:
gender = fields.Selection([], string='性别', related='users_id.gender')
标签:fields,gender,odoo,related,视图,many2one,id,users 来源: https://www.cnblogs.com/jackadam/p/16467603.html