コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
8180 ビュー

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
27332
0
1月 17
3345
1
11月 24
1521
3
4月 23
18096
1
12月 22
14230