Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
8167 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
3
juil. 18
27329
0
janv. 17
3343
1
nov. 24
1516
3
avr. 23
18089
1
déc. 22
14224