跳至內容
選單
此問題已被標幟
1 回覆
4197 瀏覽次數

I have generated an xml file with python and trying to attach it with a binary field or I can download it directly into the user browser. I am open to use any one of the option. For now I am trying the following code :

sepa.export(validate=True)

contents = sepa.export()

doc = minidom.parseString(contents)

filee = open("/home/odoo/xml_files/" + str(self.name) + ' - ' + str(res) + ".xml", "w+")

doc.writexml(filee)

out = filee.read()

filee.close()

self.write({'report': base64.b64encode(bytes(out, 'utf-8')), 'filename':  str(self.name) + ' - ' + str(res)})

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
6月 24
2645
2
12月 23
12512
3
4月 24
5720
0
7月 22
1068
3
7月 22
22816