Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
3203 Näkymät

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



Avatar
Hylkää
Tekijä

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

Paras vastaus

Hi Mohamed,

Try ,

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

Hope it helps,
Kiran K

Avatar
Hylkää
Paras vastaus

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 

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
syysk. 24
1226
2
jouluk. 23
25332
0
heinäk. 18
4072
0
maalisk. 15
4041
1
maalisk. 15
3400