Odoo Help


[SOLVED] Convert picture bytea to binary in a python file

on 9/9/13, 6:37 PM 3,071 views

Hi everybody,

I would like to know if it possible to concert bytea picture into binary. I take the bytea into a field of the database and i want to "put" it into a binary field like this:

cr.execute('SELECT res_company.logo_web FROM res_company') res = cr.fetchall() v['logo_Print'] =base64.decodestring(str(res[0]))

But doesn't work.

Someone have some idea, please? How is possible to concert my "tuple" into a string and after binary?

Thanks a lot!



Andreas Brueckl

--Andreas Brueckl--

| 7 8 7
Vienna, Austria
--Andreas Brueckl--
OpenERP Consulting and Development
Andreas Brueckl
On 9/18/13, 12:29 PM

cr.fetchall() returns an array of arrays. If you cant to access the first column (logo_web) of the first row (I assume that there is only one row/company), then you have to use res[0][0].

Hi Andreas, Thank you for your help. It works!

on 12/17/13, 1:10 PM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 9/9/13, 6:37 PM
Seen: 3071 times
Last updated: 3/16/15, 8:10 AM