Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
8199 Vizualizări

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


Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
3
iul. 18
27341
0
ian. 17
3354
1
nov. 24
1543
3
apr. 23
18124
1
dec. 22
14244