Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
5594 Näkymät

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
Hylkää

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

Paras vastaus

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
Hylkää
Tekijä

Thank you Cybrosys, works like a charm. Regards

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
5
syysk. 19
6294
1
lokak. 24
1613
3
lokak. 23
8731
1
syysk. 23
3304
1
toukok. 23
2243