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

Hi all,

I am new to Odoo and using version 12 for learning.

I have a form with 2 fields.  Field_1 and Field_2.

I want to make "Field_2" readonly if Field_1 is not filled.

How can I achieve that?

Thank you in advance

Best regards


アバター
破棄

This Odoo customization tips will helps you: http://learnopenerp.blogspot.com

最善の回答

Hi,

Simply what you can do is that use attributes, take the case of field_1 and field_2.

In the XML, you can define the field_2 like this, so that the field_2 will be read-only until there is a value in field_1.


<field name="field_2" attrs="{'readonly':[('field_1','=',False)]}"/>


Thanks

アバター
破棄
著作者

Thank you Cybrosys, works like a charm. Regards

関連投稿 返信 ビュー 活動
5
9月 19
6292
1
10月 24
1604
3
10月 23
8728
1
9月 23
3302
1
5月 23
2241