Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
3221 Lượt xem

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



Ảnh đại diện
Huỷ bỏ
Tác giả

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

Câu trả lời hay nhất

Hi Mohamed,

Try ,

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

Hope it helps,
Kiran K

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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 

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 9 24
1235
2
thg 12 23
25345
0
thg 7 18
4078
0
thg 3 15
4050
1
thg 3 15
3408