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

For some reason, I need to put a button inside the form and make it ONLY exist when the user editing it.

what should I put inside the button?

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

Try using class="oe_edit_only"

<button name="button_dummy"
        states="draft,sent" string="(update)" type="object" class="oe_edit_only oe_link"/>

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

Try attrs with the following domain: [('id', '>', 0)].  First you need to redefine id column and put it in the form view (with invisible = True if you don't want the field to show).

You can also try to add create="false" as the button's attribute.

อวตาร
ละทิ้ง