Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
8177 Представления

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

Аватар
Отменить
Related Posts Ответы Просмотры Активность
3
июл. 18
27331
0
янв. 17
3344
1
нояб. 24
1521
3
апр. 23
18093
1
дек. 22
14230