This question has been flagged

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
Discard
Best Answer

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
Discard
Author

@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