diff --git a/datev_export_xml/models/datev_xml_generator.py b/datev_export_xml/models/datev_xml_generator.py index 82ef2647..afd20a31 100644 --- a/datev_export_xml/models/datev_xml_generator.py +++ b/datev_export_xml/models/datev_xml_generator.py @@ -83,7 +83,9 @@ def generate_xml_document(self, invoices, check_xsd=True): "Document_v050.xsd", ) - return "document.xml", etree.tostring(root) + return "document.xml", etree.tostring( + root, xml_declaration=True, encoding="UTF-8" + ) @api.model def generate_xml_invoice(self, invoice, check_xsd=True): @@ -102,4 +104,4 @@ def generate_xml_invoice(self, invoice, check_xsd=True): invoice=invoice, ) - return doc_name, etree.tostring(root) + return doc_name, etree.tostring(root, xml_declaration=True, encoding="UTF-8")