コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
4106 ビュー

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! :)

アバター
破棄
最善の回答

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
9033
6
8月 20
9066
0
4月 15
7882
1
8月 23
16057
2
2月 24
14412