Skip to content

Commit

Permalink
[IMP] datev_export_xml: Add xml declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
fkantelberg committed May 27, 2024
1 parent 16f8c4c commit 1e9fa32
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions datev_export_xml/models/datev_xml_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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")

0 comments on commit 1e9fa32

Please sign in to comment.