İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
14589 Görünümler

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
Vazgeç
En İyi Yanıt

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
Vazgeç
Üretici

exactly, it runs very well;

Thanks for your help.

Üretici

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.

Üretici

ok, thank you

İlgili Gönderiler Cevaplar Görünümler Aktivite
7
Haz 20
20179
1
Kas 22
2276
0
Oca 22
2527
7
Oca 24
14849
0
Tem 19
2282