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

I have a field which I would like present only for certain country:

<field name="org_no" attrs="{'invisible':[('country_id','!=','Sweden')]}"/>

country_id is default for 7.0:

country_id: fields.many2one('res.country', 'Country')

I understand that somehow I need to perform the search first - self.pool.get('res.country').search. But how to do it in a view?

アバター
破棄
最善の回答


First solution is:

attrs = invisible:[('country_id.name', '!='  ,'Sweden' )]

second :

Create one related field

country_name = fields.Char(related='country_id.name', 'Coutnry name') add this field in as invisble

you can add attrs as below

attrs = invisible:[(country_name', '!='  ,'Sweden')]


アバター
破棄
関連投稿 返信 ビュー 活動
1
10月 24
69368
2
12月 23
25814
1
3月 15
6807
1
3月 15
6786
3
12月 23
21656