콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다

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.




아바타
취소
관련 게시물 답글 화면 활동
0
5월 23
2040
1
7월 19
3585
26
7월 21
62069
0
2월 21
3809
0
5월 20
3932