Skip to content

Commit

Permalink
[IMP] l10n_it_edi_proxy: ack of the initial state is useless
Browse files Browse the repository at this point in the history
When we receive status changes of sent invoices, we send an
ack message to the proxy afterwards to indicate we received it
correctly.

However, as awaiting_outcome is the initial state for which no
message about the invoice state was received from the gov, we do
not need to ack it as it just says "we are still waiting for the
first msg from the gov"

In a scenario:

Normal flow:

- Odoo instance sends invoice to proxy, proxy to gov, which sends back transaction_id
- On the proxy, the state of the transaction_id is awaiting_outcome
- The gov sends a message back to the proxy that the invoice is approved (directly to the server), so the state becomes "approved"
- The odoo instance asks for the status, receives the "approved" message and then tells the proxy he received it
- The proxy deletes the "approved" message

What we want to avoid:

- Odoo instance sends the invoice
- Proxy: awaiting_outcome
- Odoo instance checks the status and the server returns "awaiting_outcome"
- The gov sends a new message
- The Odoo instance acks and says he received the msg (there is actually no message associated)
- The new message from the government gets deleted.

closes odoo#91578

X-original-commit: 7d992af
Signed-off-by: William André (wan) <wan@odoo.com>
  • Loading branch information
jco-odoo committed May 17, 2022
1 parent b0537fe commit 21fd835
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion addons/l10n_it_edi_sdicoop/models/account_edi_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ def _l10n_it_post_invoices_step_2(self, invoices):
'error': _('The invoice was sent to FatturaPA, but we are still awaiting a response. Click the link above to check for an update.'),
'blocking_level': 'info',
}
proxy_acks.append(id_transaction)
continue
elif state == 'not_found':
# Invoice does not exist on proxy. Either it does not belong to this proxy_user or it was not created correctly when
Expand Down

0 comments on commit 21fd835

Please sign in to comment.