跳至内容
菜单
此问题已终结
1 回复
6613 查看

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
1417
2
4月 22
4068
0
10月 21
2630
2
5月 20
12180
2
12月 17
4295