Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
14884 Näkymät

I upload an excel file on odoo by “fields.Binary” and assign it to “filedata”;

now I think it is an binary format, I want to read out its data from the “filedata”, How shall I?

Avatar
Hylkää
Paras vastaus

use this code to convert and save it to a file

import base64

f = open("/path/to/file/spreadsheet.xls", "wb")
f.write(self.filedata.decode('base64'))

# f.read()

f.close()
Avatar
Hylkää
Tekijä

exactly, it runs very well;

Thanks for your help.

Tekijä

Another problem: shall I write the modified data back into a new Excel file?

Assuming you mean to modify your excel file (Binary data),

after modifying, you will need to reassign the excel file to your field, or you can do this through the UI itself.

Tekijä

ok, thank you

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
7
kesäk. 20
20682
1
marrask. 22
2528
0
tammik. 22
2771
7
tammik. 24
15160
0
heinäk. 19
2454