跳至内容
菜单
此问题已终结
2 回复
8166 查看

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


形象
丢弃
最佳答案

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

形象
丢弃
相关帖文 回复 查看 活动
3
7月 18
27328
0
1月 17
3343
1
11月 24
1514
3
4月 23
18088
1
12月 22
14223