Fix errors when query issued and received invoices.
This commit refs #21251
This commit is contained in:
parent
e04ee7ac22
commit
0815ecc62a
3
aeat.py
3
aeat.py
|
@ -671,6 +671,7 @@ class SIIReport(Workflow, ModelSQL, ModelView):
|
|||
else:
|
||||
sujeta = tipo_desglose.DesgloseTipoOperacion.Entrega.Sujeta
|
||||
|
||||
if sujeta:
|
||||
if sujeta.NoExenta:
|
||||
for detail in sujeta.NoExenta.DesgloseIVA.DetalleIVA:
|
||||
taxes_to_create.append({
|
||||
|
@ -843,7 +844,7 @@ class SIIReport(Workflow, ModelSQL, ModelView):
|
|||
_logger.debug(res)
|
||||
registers = res.RegistroRespuestaConsultaLRFacturasRecibidas
|
||||
pagination = res.IndicadorPaginacion
|
||||
last_invoice = registers[-1].IDFactura
|
||||
last_invoice = registers and registers[-1].IDFactura or None
|
||||
|
||||
# FIXME: the reference is not forced to be unique
|
||||
lines_to_create = []
|
||||
|
|
Loading…
Reference in New Issue