Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
3852 Weergaven

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
Annuleer

use domain

Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
2
jul. 24
7980
2
mei 25
4195
1
jul. 18
9714
4
nov. 20
8008
0
aug. 19
3600