Skip to content

Commit

Permalink
[FIX] l10n_eg_edi_eta: avoid infinite loop by setting the blocking le…
Browse files Browse the repository at this point in the history
…vel to error

If you have only blocking level warning/info and
the batch is bigger than 25, then it will generate
an infinite loop.  In order to avoid that, when an invoice
is still to be signed we put it in error, also because
a manual intervention of the user is required anyways.

closes odoo#98230

Signed-off-by: William André (wan) <wan@odoo.com>
  • Loading branch information
jco-odoo committed Aug 17, 2022
1 parent 2b2ff73 commit a707934
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/l10n_eg_edi_eta/models/account_edi_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,15 +348,15 @@ def _post_invoice_edi(self, invoices):
return {
invoice: {
'error': _("An error occured in created the ETA invoice, please retry signing"),
'blocking_level': 'info'
'blocking_level': 'error'
}
}
invoice_json = json.loads(invoice.l10n_eg_eta_json_doc_id.raw)['request']
if not invoice_json.get('signatures'):
return {
invoice: {
'error': _("Please make sure the invoice is signed"),
'blocking_level': 'info'
'blocking_level': 'error'
}
}
return {invoice: self._l10n_eg_edi_post_invoice_web_service(invoice)}
Expand Down

0 comments on commit a707934

Please sign in to comment.