Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
3831 Visualizzazioni

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
Abbandona

use domain

Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
lug 24
7976
2
mag 25
4192
1
lug 18
9713
4
nov 20
8005
0
ago 19
3588