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! :)
لقد تم الإبلاغ عن هذا السؤال
2
الردود
6075
أدوات العرض
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 ?
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيل| المنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
|---|---|---|---|---|
|
|
2
نوفمبر 25
|
11195 | ||
|
|
1
نوفمبر 25
|
1952 | ||
|
|
6
أغسطس 20
|
11354 | ||
|
|
0
أبريل 15
|
9565 | ||
|
|
1
أغسطس 23
|
18318 |