Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4285 Lượt xem

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)})

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 6 24
2743
2
thg 12 23
12698
3
thg 4 24
5850
0
thg 7 22
1161
3
thg 7 22
23058