跳至內容
選單
此問題已被標幟
1 回覆
6657 瀏覽次數

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
12月 24
1475
2
4月 22
4114
0
10月 21
2651
2
5月 20
12221
2
12月 17
4320