콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
3198 화면

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 

아바타
취소
관련 게시물 답글 화면 활동
1
9월 24
1226
2
12월 23
25306
0
7월 18
4072
0
3월 15
4038
1
3월 15
3398