Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
5568 Представления

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

Related Posts Ответы Просмотры Активность
5
сент. 19
6267
1
окт. 24
1505
3
окт. 23
8659
1
сент. 23
3252
1
мая 23
2224