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

hi everyone 
i want to disable delete button in manytomany attachment field.

this is my code :


i just want to disable the X button from that widget when state is != to draft 
i hope u can help me



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

hi 
thank you for your response. i want to keep the create in my field i want that user can create an attachment but he cant delete it

Here the user can create/delete in the draft state and is not able to create/delete in any other state

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

Hi Mohamed,

Try ,

<field name="attachment_id" widget="many2many_binary" attrs="{'readonly':[('state','!=','draft')]}" />

Hope it helps,
Kiran K

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

Hi,

For this purpose i created a custom widget please check it out https://apps.odoo.com/apps/modules/16.0/cbu_advance_m2m_binary_widget 

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ย. 24
1221
2
ธ.ค. 23
25295
0
ก.ค. 18
4065
0
มี.ค. 15
4031
1
มี.ค. 15
3393