Skip to Content
मेन्यू
This question has been flagged
1 Reply
6574 Views

Let's say I add attachments to products. 

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

Avatar
Discard

where do you add this code 

Author 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
Discard

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 Views Activity
0
दिस॰ 24
1369
2
अप्रैल 22
4040
0
अक्तू॰ 21
2594
2
मई 20
12143
2
दिस॰ 17
4245