Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
6642 Vizualizări

Let's say I add attachments to products. 

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

Imagine profil
Abandonează

where do you add this code 

Autor Cel mai bun răspuns
I solved it by:
@api.model
def create(self, vals):
picture_public = {'public': True}
vals.update(picture_public)
return super().create(vals

Imagine profil
Abandonează

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 Răspunsuri Vizualizări Activitate
0
dec. 24
1447
2
apr. 22
4094
0
oct. 21
2637
2
mai 20
12208
2
dec. 17
4308