تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
5688 أدوات العرض

Let's say I add attachments to products. 

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

الصورة الرمزية
إهمال

where do you add this code 

الكاتب أفضل إجابة
I solved it by:
@api.model
def create(self, vals):
picture_public = {'public': True}
vals.update(picture_public)
return super().create(vals

الصورة الرمزية
إهمال

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?

المنشورات ذات الصلة الردود أدوات العرض النشاط
0
ديسمبر 24
645
2
أبريل 22
3208
0
أكتوبر 21
2109
2
مايو 20
11529
2
ديسمبر 17
3688