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

I want to make a field readonly in edit mode and editable in create mode in openerp. I want a field for which value is specified while creating and later it should not be changed.

This is my code:

<field name = "apply_to_future" class="oe_edit_only" attrs="{'readonly':[('status','=','Draft')]}" />

 

Thanks in advance

Avatar
Hylkää
Paras vastaus

Have you tried including ID in the view and set the attrs="{'readonly':[('id','>',0)]}" ?

Avatar
Hylkää
Tekijä Paras vastaus

Thanks Ivan,

We got, 

attrs="{'readonly':[('pay_value','!=',False)]}"

Avatar
Hylkää
Tekijä

attrs="{'readonly':[('pay_value','!=',False)]}"