Files
odoo_source/addons
Julien Van Roy 9a2e53e45c [FIX] account_edi_ubl_cii: no xml declaration with the send & print
Issue: the xml declaration "<?xml version='1.0' encoding='UTF-8'?>" is
lost when opening the send & print wizard with existing xml attachments.

Explanation: When opening the send and print wizard, the PDF are
generated and postprocessed by `_postprocess_pdf_report`. In the
`_postprocess_pdf_report` override in `account_edi_ubl_cii`, the xml
attachments are parsed through `tree = etree.fromstring(xml)`, then the
base64 PDF is inserted, and the etree is converted to a bytes through
`etree.tostring(cleanup_xml_node(tree))` and the resulting bytes is
written back on the attachment, but the xml declaration disappeared.

Solution: include the arguments `xml_declaration=True, encoding='UTF-8'`
in the `tostring` function when converting the etree to a bytes.

opw-3144519

closes odoo/odoo#125523

X-original-commit: ed9a1d83bd7d496a316e8da6a201ca3a14c99d19
Signed-off-by: Julien Van Roy <juvr@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
2023-06-19 03:24:39 +02:00
..
2023-06-12 22:39:26 +02:00
2023-06-12 22:39:26 +02:00
2023-06-16 14:59:34 +02:00
2023-06-12 22:39:26 +02:00
2023-06-12 22:39:26 +02:00
2023-06-12 22:39:26 +02:00
2023-05-11 10:40:53 +02:00
2023-05-11 10:40:55 +02:00
2023-06-08 21:52:44 +02:00
2023-06-12 22:39:26 +02:00
2023-06-12 22:39:26 +02:00
2023-06-12 22:39:26 +02:00