İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
3824 Görünümler

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
Vazgeç

use domain

En İyi Yanıt

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
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Tem 24
7975
2
May 25
4191
1
Tem 18
9713
4
Kas 20
8004
0
Ağu 19
3586