Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
6527 Widoki

Let's say I add attachments to products. 

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

Awatar
Odrzuć

where do you add this code 

Autor Najlepsza odpowiedź
I solved it by:
@api.model
def create(self, vals):
picture_public = {'public': True}
vals.update(picture_public)
return super().create(vals

Awatar
Odrzuć

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?

Powiązane posty Odpowiedzi Widoki Czynność
0
gru 24
1334
2
kwi 22
3984
0
paź 21
2553
2
maj 20
12123
2
gru 17
4215