Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3841 Widoki

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

Awatar
Odrzuć

use domain

Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
lip 24
7977
2
maj 25
4193
1
lip 18
9714
4
lis 20
8005
0
sie 19
3594