Search code examples
pythonpython-3.6odooodoo-11

How to save value of binary field from odoo-11 to the desired location on my computer?


I have stored pdf file into the binary filed in odoo-11, now I want to store that pdf file on my desktop. So how can I archive it in odoo-11 ?


Solution

  • Solved :- below is the code to store binary file from odoo field to your file system

    with open(os.path.join('path_where_file_will_be_downloaded', 'filename.extension'), "wb+") as f:
        f.write(name_of_binary_field)