İçereği Atla
Menü
Bu soru işaretlendi
1278 Görünümler

Hi everyone,  am migrating a database with thousands of products from odoo12 running in docker container, Trying to export large numbers of images using the Odoo web interface is not possible at all, the images after decoded from the base64 included in the csv exported from web interface are completely broken. (https://i.sstatic.net/FyWvDXGV.png)


So plan B is to get the images from a query straight outta the database on a csv, im a total newb when it comes to psql, nevertheless here is what i tried

SELECT "id","name", "image" from product_template where "image" is not null;

images nowhere to be found.


after quite a few failed attempt of fetching the image from product_template i realize that images in **Odoo12** are storaged actually inside the ir_attachment table, using the  "datas" field so according to another post in this forum, i modify my query to the following:


Select "id", "res_name", "datas_fname" from ir_attachment WHERE res_model = 'product.template' and "datas_fname" is not null;


which gives me the following data output: docs.google.com/spreadsheets/d/1QR_HTSiYxUXOSl-2nS0MaDY7QHRMbux-43RhbB1eYak/edit?usp=sharing


now the big question i have spent hours scratching my head on is: Where are the binaries?


heres a sample of the complete ir_attachments table with full rows using this query

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


docs.google.com/spreadsheets/d/1g1zZrTLu56MU7S5O5nzg-QQtsLa8QaE7jflddnRb9Wo/edit?usp=sharing


if someone could lend me a hand finding out where the actual image data is so i could extract it from a csv or making python script, i would be eternally grateful.


thanks.




Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
0
May 23
2091
1
Tem 19
3606
26
Tem 21
62192
0
Şub 21
3839
0
May 20
3969