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! :)
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Účtovníctvo
- Sklady
- PoS
- Project
- MRP
This question has been flagged
2
Replies
4010
Zobrazenia
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 ?
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
RegistráciaRelated Posts | Replies | Zobrazenia | Aktivita | |
---|---|---|---|---|
|
2
okt 21
|
8953 | ||
|
6
aug 20
|
8959 | ||
|
0
apr 15
|
7779 | ||
|
1
aug 23
|
15949 | ||
|
2
feb 24
|
14270 |