Skip to Content
Menu
This question has been flagged
1 Odpoveď
4058 Zobrazenia

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

Avatar
Zrušiť

use domain

Best Answer

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

Avatar
Zrušiť
Related Posts Replies Zobrazenia Aktivita
2
júl 24
8350
2
máj 25
4487
1
júl 18
9968
4
nov 20
8324
0
aug 19
3920