Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
4127 Weergaven

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
Annuleer
Beste antwoord

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
Annuleer
Auteur Beste antwoord

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

Avatar
Annuleer

Can you share an example to resolve your problem ?

Gerelateerde posts Antwoorden Weergaven Activiteit
2
okt. 21
9046
6
aug. 20
9084
0
apr. 15
7894
1
aug. 23
16061
2
feb. 24
14420