Skip to Content
मेन्यू
This question has been flagged
2 Replies
4159 Views

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! :)

Avatar
Discard
Best Answer

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.

Avatar
Discard
Author Best Answer

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

Avatar
Discard

Can you share an example to resolve your problem ?

Related Posts Replies Views Activity
2
अक्तू॰ 21
9109
6
अग॰ 20
9126
0
अप्रैल 15
7917
1
अग॰ 23
16092
2
फ़र॰ 24
14449