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

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
1480
2
أبريل 22
4120
0
أكتوبر 21
2653
2
مايو 20
12224
2
ديسمبر 17
4322