From fd7f4f7e22679bdd4e730b989417cdee0d13979f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Sat, 26 Jul 2025 23:09:17 +0000 Subject: [PATCH 1/2] [IMP] l10n_br_nfe: fix nfe xml indent warning --- l10n_br_nfe/models/document.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/l10n_br_nfe/models/document.py b/l10n_br_nfe/models/document.py index c4d09f1b91e4..6290186eb7e0 100644 --- a/l10n_br_nfe/models/document.py +++ b/l10n_br_nfe/models/document.py @@ -956,10 +956,7 @@ def _document_export(self, pretty_print=True): result = super()._document_export() for record in self.filtered(filter_processador_edoc_nfe): edoc = record.serialize()[0] - processador = record._edoc_processor() - xml_file = processador.render_edoc_xsdata(edoc, pretty_print=pretty_print)[ - 0 - ] + xml_file = edoc.to_xml() # Delete previous authorization events in draft if ( record.authorization_event_id @@ -977,8 +974,13 @@ def _document_export(self, pretty_print=True): document_id=self, ) record.authorization_event_id = event_id - xml_assinado = processador.assina_raiz(edoc, edoc.infNFe.Id) - self._validate_xml(xml_assinado) + signed_xml = edoc.sign_xml( + xml_file, + self.company_id.certificate.file, + self.company_id.certificate.password, + edoc.infNFe.Id, + ) + self._validate_xml(signed_xml) return result def _nfe_update_status_and_save_data(self, process): From 246b759e4471d423406f58c14e6ace5a3c77d69f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Sat, 26 Jul 2025 23:09:34 +0000 Subject: [PATCH 2/2] [IMP] l10n_br_mdfe: fix mdfe xml indent warning --- l10n_br_mdfe/models/document.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/l10n_br_mdfe/models/document.py b/l10n_br_mdfe/models/document.py index 94f9ae94db0d..27813a686231 100644 --- a/l10n_br_mdfe/models/document.py +++ b/l10n_br_mdfe/models/document.py @@ -977,8 +977,14 @@ def _document_export(self, pretty_print=True): document_id=self, ) record.authorization_event_id = event_id - xml_assinado = processador.assina_raiz(edoc, edoc.infMDFe.Id) - self._validate_xml(xml_assinado) + signed_xml = edoc.sign_xml( + xml_file, + self.company_id.certificate.file, + self.company_id.certificate.password, + edoc.infMDFe.Id, + ) + self._validate_xml(signed_xml) + return result def _validate_xml(self, xml_file):