İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
6586 Görünümler

Let's say I add attachments to products. 

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

Avatar
Vazgeç

where do you add this code 

Üretici En İyi Yanıt
I solved it by:
@api.model
def create(self, vals):
picture_public = {'public': True}
vals.update(picture_public)
return super().create(vals

Avatar
Vazgeç

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?

İlgili Gönderiler Cevaplar Görünümler Aktivite
0
Ara 24
1375
2
Nis 22
4044
0
Eki 21
2597
2
May 20
12151
2
Ara 17
4247