Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
2 Besvarelser
8213 Visninger

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
Kassér
Bedste svar

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
Kassér
Related Posts Besvarelser Visninger Aktivitet
3
jul. 18
27353
0
jan. 17
3362
1
nov. 24
1563
3
apr. 23
18147
1
dec. 22
14259