I am migrating a database with thousands of products from odoo12 erp running in docker, Trying to export large numbers of images using the Odoo web interface is not possible at all, the images after decoded from base64 in the csv exported from web interface are completely broken.
broken output sample
So plan B is to get the images from a SQL query straight outta the database and get it on a csv, main problem, im a total newb when it comes to psql, nevertheless here we go:
i was able to obtain products id, and name from this basic query:
SELECT "id","name" from product_template as
but images nowhere to be found.
after quite a few failed attempt of fetching the image from product_template i realizethat images in Odoo12 are storaged actually inside the ir_attachment table.
so i modify my query to the following:
SELECT id, store_fname FROM ir_attachment WHERE res_model = 'product.template' AND res_field = 'image';
and i get the following data sample
now my main problem is, this are not the images i tried decoding base64 decoding them and negative.
¿does anyone have any idea how i can fetch the image data? honestly im clueless at this point.