Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
2 Respostas
8580 Visualizações

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
Cancelar
Melhor resposta

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
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
3
jul. 18
27706
0
jan. 17
3533
1
nov. 24
2062
3
abr. 23
18910
1
dez. 22
14910