跳至内容
菜单
此问题已终结
1 回复
3870 查看

Hi,

am using odoo 11 , i have a many2one field of res.users in invoice form, in the selection there should only the users if the current company is in their allowed companies.How can i filter this.

this is my many2one field in account.invoice

chair_user = fields.Many2one('res.users', string="Signed")

Thanks in advance

形象
丢弃

use domain

最佳答案

Hi,

Try by setting the domain like this.

def _get_domain(self):
return [('company_ids', 'in', [self.env.company.id])]

chair_user = fields.Many2one('res.users', string="Signed", domain=_get_domain)

Regards

形象
丢弃
相关帖文 回复 查看 活动
2
7月 24
8025
2
5月 25
4214
1
7月 18
9742
4
11月 20
8022
0
8月 19
3633