From 38bb267e550d953fed92f9ad77ab66f4b9298483 Mon Sep 17 00:00:00 2001 From: el Mau Date: Fri, 17 Feb 2023 14:24:17 -0600 Subject: [PATCH] Fix in tax object 04 --- source/app/controllers/cfdi_xml.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/app/controllers/cfdi_xml.py b/source/app/controllers/cfdi_xml.py index 3743972..fc0aa87 100644 --- a/source/app/controllers/cfdi_xml.py +++ b/source/app/controllers/cfdi_xml.py @@ -387,6 +387,10 @@ class CFDI(object): for field in fields: if field in datos: attributes[field] = datos[field] + + if not attributes: + return + node_name = '{}:Impuestos'.format(self._pre) impuestos = ET.SubElement(self._cfdi, node_name, attributes)