Merge branch '#23066' into '6.0'

Fix error query issued invoices.

See merge request datalifeit/trytond-aeat_sii!6
This commit is contained in:
José Antonio Díaz Miralles 2022-05-20 08:58:11 +00:00
commit 090e87e98c
1 changed files with 2 additions and 2 deletions

View File

@ -632,7 +632,7 @@ class SIIReport(Workflow, ModelSQL, ModelView):
else:
sujeta = tipo_desglose.DesgloseTipoOperacion.Entrega.Sujeta
if sujeta.NoExenta:
if sujeta and sujeta.NoExenta:
for detail in sujeta.NoExenta.DesgloseIVA.DetalleIVA:
taxes_to_create.append({
'base': _decimal(detail.BaseImponible),
@ -644,7 +644,7 @@ class SIIReport(Workflow, ModelSQL, ModelView):
detail.CuotaRecargoEquivalencia),
})
taxes = SIIReportLineTax.create(taxes_to_create)
elif sujeta.Exenta:
elif sujeta and sujeta.Exenta:
exemption = sujeta.Exenta.DetalleExenta[0].CausaExencion
for exempt in EXEMPTION_CAUSE:
if exempt[0] == exemption: