Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
6656 Visualizações

Let's say I add attachments to products. 

How can enable all uploaded images to be available to public by default?

Avatar
Cancelar

where do you add this code 

Autor Melhor resposta
I solved it by:
@api.model
def create(self, vals):
picture_public = {'public': True}
vals.update(picture_public)
return super().create(vals

Avatar
Cancelar

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?

Publicações relacionadas Respostas Visualizações Atividade
0
dez. 24
1475
2
abr. 22
4114
0
out. 21
2649
2
mai. 20
12221
2
dez. 17
4320