Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
5591 Ansichten

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


Avatar
Verwerfen

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

Beste Antwort

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

Avatar
Verwerfen
Autor

Thank you Cybrosys, works like a charm. Regards

Verknüpfte Beiträge Antworten Ansichten Aktivität
5
Sept. 19
6291
1
Okt. 24
1601
3
Okt. 23
8727
1
Sept. 23
3299
1
Mai 23
2241