Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
6653 Prikazi

Let's say I add attachments to products. 

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

Avatar
Opusti

where do you add this code 

Avtor 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
Opusti

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 Odgovori Prikazi Aktivnost
0
dec. 24
1473
2
apr. 22
4110
0
okt. 21
2643
2
maj 20
12219
2
dec. 17
4319