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

Hi,

I have a many2many field(user_ids) of model res.users.In that field i only need to show the users coming under a particular group.How can i achieve this.

user_ids = fields.Many2many('res.users', String='Users')

Thanks


Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

You can give the domain for the field based on the user group like this,

user_ids = fields.Many2many('res.users', string='Recipients',
domain=lambda self: [("groups_id", "=",
self.env.ref("base.group_erp_manager").id)]
)

Thanks

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
3
lip 18
27328
0
sty 17
3340
1
lis 24
1511
3
kwi 23
18087
1
gru 22
14220