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! :)
This question has been flagged
2
Odpovědi
6013
Zobrazení
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!
Přihlásit se| Related Posts | Odpovědi | Zobrazení | Aktivita | |
|---|---|---|---|---|
|
|
2
lis 25
|
11076 | ||
|
|
1
lis 25
|
1802 | ||
|
|
6
srp 20
|
11243 | ||
|
|
0
dub 15
|
9485 | ||
|
|
1
srp 23
|
18184 |