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! :)
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- 客戶關係
- e-Commerce
- 會計
- 庫存
- PoS
- Project
- MRP
此問題已被標幟
2
回覆
3990
瀏覽次數
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
10月 21
|
8939 | ||
|
6
8月 20
|
8918 | ||
|
0
4月 15
|
7764 | ||
|
1
8月 23
|
15921 | ||
|
2
2月 24
|
14244 |