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

Hi,

am using odoo 11 , i have a many2one field of res.users in invoice form, in the selection there should only the users if the current company is in their allowed companies.How can i filter this.

this is my many2one field in account.invoice

chair_user = fields.Many2one('res.users', string="Signed")

Thanks in advance

Аватар
Отменить

use domain

Лучший ответ

Hi,

Try by setting the domain like this.

def _get_domain(self):
return [('company_ids', 'in', [self.env.company.id])]

chair_user = fields.Many2one('res.users', string="Signed", domain=_get_domain)

Regards

Аватар
Отменить
Related Posts Ответы Просмотры Активность
2
июл. 24
7976
2
мая 25
4192
1
июл. 18
9713
4
нояб. 20
8005
0
авг. 19
3588