Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
6381 Zobrazení

Let's say I add attachments to products. 

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

Avatar
Zrušit

where do you add this code 

Autor Nejlepší odpověď
I solved it by:
@api.model
def create(self, vals):
picture_public = {'public': True}
vals.update(picture_public)
return super().create(vals

Avatar
Zrušit

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 Odpovědi Zobrazení Aktivita
0
pro 24
1194
2
dub 22
3806
0
říj 21
2482
2
kvě 20
12015
2
pro 17
4103