Skip to Content
Menú
This question has been flagged
1 Respondre
6532 Vistes

Let's say I add attachments to products. 

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

Avatar
Descartar

where do you add this code 

Autor Best Answer
I solved it by:
@api.model
def create(self, vals):
picture_public = {'public': True}
vals.update(picture_public)
return super().create(vals

Avatar
Descartar

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?

Related Posts Respostes Vistes Activitat
0
de des. 24
1337
2
d’abr. 22
3999
0
d’oct. 21
2560
2
de maig 20
12126
2
de des. 17
4220