コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
6454 ビュー

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
1280
2
4月 22
3885
0
10月 21
2516
2
5月 20
12061
2
12月 17
4164