Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
8096 Prikazi

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
Opusti
Best Answer

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

Avatar
Opusti
Avtor Best Answer

Thanks Ivan,

We got, 

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

Avatar
Opusti
Avtor

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