Skip to Content
Menú
This question has been flagged
2 Respostes
8154 Vistes

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


Avatar
Descartar
Best Answer

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

Avatar
Descartar
Related Posts Respostes Vistes Activitat
3
de jul. 18
27327
0
de gen. 17
3337
1
de nov. 24
1502
3
d’abr. 23
18076
1
de des. 22
14215