Skip to content
Snippets Groups Projects
Commit 5ee53342 authored by Paolo Gatti (pgi)'s avatar Paolo Gatti (pgi)
Browse files

[FIX] l10n_it_edi_sdicoop: Revert retrigger

The trigger that downloads FatturaPA used the `_trigger` function only available in Odoo 15.
This means that if we manually re-trigger, each iteration will have less time before timeout and will eventually do.
So, we revert the change in Odoo 14.

Reversal of odoo#116373
https://github.com/odoo/odoo/pull/116373



closes odoo/odoo#116731

Signed-off-by: default avatarJosse Colpaert <jco@odoo.com>
parent d4068589
Branches
Tags
No related merge requests found
......@@ -37,15 +37,8 @@ class AccountEdiFormat(models.Model):
_logger.error('Error while receiving file from SdiCoop: %s', e)
proxy_acks = []
retrigger = False
for id_transaction, fattura in res.items():
# The server has a maximum number of documents it can send at a time
# If that maximum is reached, then we search for more
# by re-triggering the download cron, avoiding the timeout.
current_num, max_num = fattura.get('current_num', 0), fattura.get('max_num', 0)
retrigger = retrigger or current_num == max_num > 0
if self.env['ir.attachment'].search([('name', '=', fattura['filename']), ('res_model', '=', 'account.move')], limit=1):
# name should be unique, the invoice already exists
_logger.info('E-invoice already exist: %s', fattura['filename'])
......@@ -88,9 +81,6 @@ class AccountEdiFormat(models.Model):
except AccountEdiProxyError as e:
_logger.error('Error while receiving file from SdiCoop: %s', e)
if retrigger:
self.env.ref('l10n_it_edi.ir_cron_receive_fattura_pa_invoice')._trigger()
# -------------------------------------------------------------------------
# Export
# -------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment