Skip to Content
Menu
This question has been flagged
1 Atsakyti
6453 Rodiniai

Let's say I add attachments to products. 

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

Portretas
Atmesti

where do you add this code 

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

Portretas
Atmesti

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 Replies Rodiniai Veikla
0
gruod. 24
1280
2
bal. 22
3885
0
spal. 21
2516
2
geg. 20
12061
2
gruod. 17
4163