Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
6540 Tampilan

Let's say I add attachments to products. 

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

Avatar
Buang

where do you add this code 

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

Avatar
Buang

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 Terkait Replies Tampilan Aktivitas
0
Des 24
1353
2
Apr 22
4019
0
Okt 21
2565
2
Mei 20
12129
2
Des 17
4226