Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
6659 Visualizzazioni

Let's say I add attachments to products. 

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

Avatar
Abbandona

where do you add this code 

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

Avatar
Abbandona

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?

Post correlati Risposte Visualizzazioni Attività
0
dic 24
1475
2
apr 22
4116
0
ott 21
2651
2
mag 20
12221
2
dic 17
4320