İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
4016 Görünümler

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
Vazgeç
En İyi Yanıt

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
Vazgeç
Üretici En İyi Yanıt

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

Avatar
Vazgeç

Can you share an example to resolve your problem ?

İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Eki 21
8954
6
Ağu 20
8965
0
Nis 15
7780
1
Ağu 23
15955
2
Şub 24
14276