Skip to Content
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
5637 Представления

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?

Related Posts Ответы Просмотры Активность
0
дек. 24
610
2
апр. 22
3152
0
окт. 21
2082
2
мая 20
11500
2
дек. 17
3671