Skip to content

[18.0][IMP] l10n_it_edi_extension, l10n_it_edi_td29: invio massivo delle autofatture - #5340

Open
eLBati wants to merge 2 commits into
OCA:18.0from
eLBati:l10n_it_edi_extension-self-inv
Open

eLBati wants to merge 2 commits into
OCA:18.0from
eLBati:l10n_it_edi_extension-self-inv

Conversation

@eLBati

@eLBati eLBati commented Sep 28, 2026

Copy link
Copy Markdown
Member

Con il modulo standard l10n_it_edi le autofatture (es. TD17, TD18, TD19 per il reverse charge) si possono inviare allo SdI solo una alla volta, con il pulsante "Invia a SDI" della fattura fornitore:
action_l10n_it_edi_send lavora su un solo record e il wizard "Invia e stampa" accetta solo documenti di vendita.

l10n_it_edi_extension

  • Nuova azione "Send self-invoices to SDI" nelle viste elenco di fatture e registrazioni contabili, per gli utenti del gruppo Fatturazione.
  • Vengono inviate solo le autofatture che si possono inviare con il pulsante del documento: confermate, non ancora inviate e non scartate. Gli altri documenti selezionati vengono ignorati. Le condizioni sono
    nel metodo _l10n_it_edi_ext_is_self_invoice_to_send, che altri moduli possono estendere.
  • Ogni autofattura viene inviata chiamando action_l10n_it_edi_send, quindi con gli stessi controlli, lo stesso XML e lo stesso canale di invio del pulsante (proxy Odoo, oppure PEC con l10n_it_edi_pec).
  • Ogni invio avviene in un proprio savepoint. Se un'autofattura non supera i controlli o genera un errore, il motivo viene mostrato nell'avviso del documento e le altre vengono inviate comunque, senza
    annullare gli invii già fatti.
  • Al termine, una notifica riepiloga quante autofatture sono state inviate, quali non sono state inviate e quanti documenti sono stati ignorati.

l10n_it_edi_td29

  • Le comunicazioni TD29, che si inviano con lo stesso pulsante delle autofatture, sono incluse nell'azione.

Relazione con altre PR

@mrcast mrcast left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functional test: ok!

Comment thread l10n_it_edi_extension/models/account_move.py Outdated
Comment thread l10n_it_edi_extension/data/ir_actions_server.xml Outdated
Comment thread l10n_it_edi_extension/models/account_move.py Outdated
Comment thread l10n_it_edi_extension/models/account_move.py Outdated
Comment thread l10n_it_edi_td29/tests/test_send_self_invoices.py

@MaurizioPellegrinet MaurizioPellegrinet left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test funzionale: OK

@eLBati
eLBati force-pushed the l10n_it_edi_extension-self-inv branch from 9a85e1e to 323f1d8 Compare October 2, 2026 12:36
with the reason in its e-invoicing warning.
When a move raises an error, it stays unsent
with the reason in the final notification.
In both cases, the other moves are sent anyway.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quest'ultima frase non mi è molto chiara. Come dev'essere interpretata? Che nei due casi precedenti vengono comunque inviate allo SdI?

Ti propongo un'altra versione di docstring:

"""Send the selected self-invoices to the SdI.

Each move is sent with `action_l10n_it_edi_send`.
A move that cannot be sent does not stop the others:
the moves already sent stay sent and the next ones are still tried.
The reason is shown in the e-invoicing warning of the move
(failed export checks, error returned by the SdI)
or in the final notification (errors raised while sending).

Everything runs in the same transaction: if the whole request fails
(e.g. worker time limit), the moves already sent are rolled back
although the SdI has received them.
"""

Cosa ne pensi?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grazie, modificato.

Riguardo alla transazione unica, ho modificato: ogni autofattura viene committata subito dopo l'invio

eLBati added 2 commits October 6, 2026 14:36
Core l10n_it_edi only sends self-invoices (e.g. TD17 for reverse charge)
one at a time, with the "Send to SDI" button of the vendor bill form.

Add the "Send self-invoices to SDI" button to the header of the vendor
bills list view: each selected self-invoice that can be sent goes through
action_l10n_it_edi_send, like the form button, in its own savepoint.

A self-invoice that fails the export checks or raises an error does not
prevent the others from being sent.

Each self-invoice is committed right after being sent, like core
e-invoicing localizations do (e.g. l10n_ro_edi, l10n_my_edi): if the
request is interrupted, Odoo still knows which self-invoices the SdI has
received.

Assisted-by: Claude Opus 5.5
TD29 communications are sent with the same button as self-invoices:
include them in the "Send self-invoices to SDI" button of the vendor bills
list view.

Assisted-by: Claude Opus 5.5
@eLBati
eLBati force-pushed the l10n_it_edi_extension-self-inv branch from 323f1d8 to 67e8179 Compare October 6, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:l10n_it_edi_extension Module l10n_it_edi_extension mod:l10n_it_edi_td29 Module l10n_it_edi_td29 series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants