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

Let's say I add attachments to products. 

How can enable all uploaded images to be available to public by default?

Avatar
Ignorer

where do you add this code 

Auteur Meilleure réponse
I solved it by:
@api.model
def create(self, vals):
picture_public = {'public': True}
vals.update(picture_public)
return super().create(vals

Avatar
Ignorer

would be great if you described some context, as @Mohamed asked...
I have a situation where I want to enable this option for existing images too.
Which model should I inherit to change it for good?

Publications associées Réponses Vues Activité
0
déc. 24
1473
2
avr. 22
4109
0
oct. 21
2642
2
mai 20
12219
2
déc. 17
4319