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

How to hide and show a field based on the edit mode or view mode in odoo for example I want to show a field in one2many tree when the user click on edit or create button hide the field when the user click on save button view?


Your help is really appreciated

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

Hello,

To make the field appear only on edit/create you can use:

<field name="name" class="oe_edit_only"/>


Regards...

อวตาร
ละทิ้ง

Again... why is it not documented!? (Anyhow, thanks for the solution.)

คำตอบที่ดีที่สุด

Hello

You can use the class oe_edit_ony


<div class="oe_edit_only">
  <field name="your_field/>
</div>


Take a look in res partner form, where "Is a company" is using this class !

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

Thanks but class="oe_edit_only" is not working when the field is in the one2many field  it will only disable it

อวตาร
ละทิ้ง