Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
8176 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
čvc 18
27331
0
led 17
3343
1
lis 24
1521
3
dub 23
18093
1
pro 22
14230