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

Hi odoo masters.


I'm trying to add a domain in the xml, in a many2one field.

But I get the error "name 'self' is not defined"

this is the xml:


name="products_id" domain="[('company_id','=',self.env.user.company_list)]"

Thanks in advance! :)

Аватар
Отменить
Лучший ответ

You cannot use self or dot notation in the xml views. You could add a related or computed field to the model and access this value for your domain, or apply the domain in the model.

Аватар
Отменить
Автор Лучший ответ

Thanks Jort, I made it with the Web domain field from OCA and problem solved.

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

Can you share an example to resolve your problem ?

Related Posts Ответы Просмотры Активность
2
окт. 21
9106
6
авг. 20
9122
0
апр. 15
7914
1
авг. 23
16085
2
февр. 24
14441