Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
8091 มุมมอง

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

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Thanks Ivan,

We got, 

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

อวตาร
ละทิ้ง
ผู้เขียน

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