Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
6880 Vistas

How to Fetch images which are stored in file-store odoo-11

I am trying to fetch product.template image which is stored in ir_attachment in the format "39/39abfeca081b17a6b93fbeaeead3e34025a39f9c".

This is not a binary code. I tried this code in this URL \https://codebeautify.org/base64-to-image-converter. It didn't give any image. Later i understood that, this is a code in file store. When we download a Database in zip format and extract the DB we will see the file-store inside this folder "39" is a folder name and "39abfeca081b17a6b93fbeaeead3e34025a39f9c" is a image name.

My Requirement is Product Image will be fetched from other Application, how can i store this in database with binary code. So that other application will fetch that binary code and get image?

Thanks in Advance.

Avatar
Descartar
Mejor respuesta

HI Supreeth,

You just need to use "datas" field of ir.attachment object to get the binary data from filestore if you are accessing binary data from attachment object.

If you want to fetch product template image directly from product.template object, use "image" field.

I hope this will solve your problem.

Avatar
Descartar
Autor

@SudhirArya Thank you, but product.template object, "image" will not store in database rite?

Yes, image field is not stored in the database. If you are using xmlrpc, you can directly use image field to fetch the image in binary format.

what if we are using a query?

same problem for me also

Mejor respuesta

Hi, i know this is kind of an old post but im new to odoo and ive been reading about this since i need to perform a migration from DB and need those images in a folder.

ive been using the query:

Select * from ir_attachment WHERE res_model = 'product.template' and res_field = 'image' and 'db_datas' is not null

to get the binaries so i can export decode them and get my images on an output but to no avail, im not able to find those binaries in the DB, im aware db_datas is suposed to have the data i need, but where can i get those binaries?

this is the output im getting:  docs.google.com/spreadsheets/d/1g1zZrTLu56MU7S5O5nzg-QQtsLa8QaE7jflddnRb9Wo/edit?usp=sharing

i cannot export the Csv from the web interface because the image export im getting for the full resolution images is broken

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
jun 19
6025
2
sept 21
7636
1
oct 18
6817
2
ago 17
7512
0
jun 23
4316