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! :)
Se marcó esta pregunta
2
Respuestas
6038
Vistas
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 ?
¿Le interesa esta conversación? ¡Participe en ella!
Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.
Registrarse| Publicaciones relacionadas | Respuestas | Vistas | Actividad | |
|---|---|---|---|---|
|
|
2
nov 25
|
11135 | ||
|
|
1
nov 25
|
1844 | ||
|
|
6
ago 20
|
11290 | ||
|
|
0
abr 15
|
9514 | ||
|
|
1
ago 23
|
18237 |