Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
2857 Vues

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
Ignorer
Auteur

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

Meilleure réponse

Hi Mohamed,

Try ,

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

Hope it helps,
Kiran K

Avatar
Ignorer
Publications associées Réponses Vues Activité
1
sept. 24
1019
2
déc. 23
25025
0
juil. 18
3873
0
mars 15
3816
1
mars 15
3189