Let's say I add attachments to products.
How can enable all uploaded images to be available to public by default?
Let's say I add attachments to products.
How can enable all uploaded images to be available to public by default?
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?
Opret en konto i dag for at få glæde af eksklusive funktioner, og bliv en del af vores skønne fællesskab!
Tilmeld dig| Relaterede indlæg | Besvarelser | Visninger | Aktivitet | |
|---|---|---|---|---|
|
0
dec. 24
|
3817 | |||
|
2
apr. 22
|
6552 | |||
|
0
okt. 21
|
4289 | |||
|
2
maj 20
|
14073 | |||
|
2
dec. 17
|
6240 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.
where do you add this code