Odoo Help


Programatically fill binary field v6.0 [Closed]

on 4/18/13, 8:36 AM 2,283 views

The Question has been closed

Sudhir Arya (ERP Harbor Consulting Services)
on 04/19/2013 15:30:57

I am generating and then saving a .zip file in python and need to save it in a binary field using the self.write(...) method. What kind of object should I pass as the value for the binary field in the write method?

On 4/19/13, 7:09 AM

This did it:

file_base64 = ''
with open(file_path, "rb") as file:
    file_base64 = base64.b64encode(file.read())

self.write(cr, uid, id, {'file': file_base64})

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: 4/18/13, 8:36 AM
Seen: 2283 times
Last updated: 3/16/15, 8:10 AM