Help

1

Where are stored the images ?

Avatar
The Food Hub CVBA

Hi ! 


I'm modifying the Product Labels view in Odoo V.0. I'd like to insert pictures linked to the activation of new fields I've created.

Can you tell me where the images are stored so I can refer to this URL or something else in my view ?

Thanks !


4 Commenti
Avatar
Abbandona
Avatar
Waleed Mohsen
-

product images stored in DB as Binary and you can find it in image_medium field under Product.Template model

Avatar
The Food Hub CVBA
-
Hi Waleed ! 

Thanks for your reply ! 
My question is not clear. It's not about product image but about other images like the one attached, linked to a new field I've created.
Example : my field is "Organic" 
If "Organic" is true, then the image attached will appear on my label.
So I need to be able to store this image on my DB and then to refer to it so I can write something like...
<t t-if="product.organic">
    <img ... > </img>
</t>



Picto_Feuille_BIO.jpg

Le lun. 22 janv. 2018 à 18:03, Waleed Mohsen <mohsen.waleed@gmail.com> a écrit :

product images stored in DB as Binary and you can find it in image_medium field under Product.Template model

--
Waleed Mohsen


Sent by Odoo S.A. using Odoo.

Avatar
Waleed Mohsen
-

try this

Store it in your module folder under static/src/img and you reference it from XML

<img src='/module name/static/src/img/image_name />

Avatar
The Food Hub CVBA
-
Thanks for your answer ! 
I'm sorry... I'm a real beginner.
Can you tell me how to access ir_attachments so I can upload images and then reference them in my Product Label view ?

Le lun. 22 janv. 2018 à 19:42, Hilar <hilarak@gmail.com> a écrit :

A new answer on Where are stored the images ? has been posted. Click here to access the post :

See post



Sent by Odoo S.A. using Odoo.

1 Risposta
2
Avatar
Hilar Andikkadavath
Best Answer

All attachments in odoo are stored under the table ir_attachments. Here odoo stores the res_model, res_id, its binary data, then the file type and so on.

Avatar
Abbandona