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
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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
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
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up| Related Posts | Replies | Views | Activity | |
|---|---|---|---|---|
|
5
Sep 19
|
7101 | |||
|
2
Oct 25
|
1945 | |||
|
1
Oct 24
|
7825 | |||
|
3
Oct 23
|
10639 | |||
|
1
Sep 23
|
3981 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.
This Odoo customization tips will helps you: http://learnopenerp.blogspot.com