跳至内容
菜单
此问题已终结
2 回复
3104 查看

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
1189
2
12月 23
25223
0
7月 18
4028
0
3月 15
3984
1
3月 15
3352