Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
8105 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Autor Najlepsza odpowiedź

Thanks Ivan,

We got, 

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

Awatar
Odrzuć
Autor

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