Skip to content

[16.0] new module l10n_it_fatturapa_out_dn#4054

Closed
TheMule71 wants to merge 2 commits into
OCA:16.0from
TheMule71:16.0-mig-l10n_it_fatturapa_out_dn
Closed

[16.0] new module l10n_it_fatturapa_out_dn#4054
TheMule71 wants to merge 2 commits into
OCA:16.0from
TheMule71:16.0-mig-l10n_it_fatturapa_out_dn

Conversation

@TheMule71

@TheMule71 TheMule71 commented Mar 14, 2024

Copy link
Copy Markdown
Contributor

Fixes #4005

Modulo di collegamento tra l10n_it_fatturapa_out e l10n_it_delivery_note
vd. anche #2202

@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.

LGTM

@TheMule71 TheMule71 force-pushed the 16.0-mig-l10n_it_fatturapa_out_dn branch from bf6b932 to 06aceaf Compare May 28, 2024 14:15
@francesco-ooops

Copy link
Copy Markdown
Contributor

/ocabot rebase

@OCA-git-bot

Copy link
Copy Markdown
Contributor

@francesco-ooops The rebase process failed, because command git rebase origin/16.0 failed with output:

Rebasing (1/2)
Auto-merging l10n_it_fatturapa_out/data/invoice_it_template.xml
CONFLICT (content): Merge conflict in l10n_it_fatturapa_out/data/invoice_it_template.xml
error: could not apply 05ae68b5a... [REF] l10n_it_fatturapa_out: Allow to exclude lines from e-invoice
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 05ae68b5a... [REF] l10n_it_fatturapa_out: Allow to exclude lines from e-invoice

@francesco-ooops

Copy link
Copy Markdown
Contributor

@TheMule71 puoi fare rebase?

@TheMule71 TheMule71 force-pushed the 16.0-mig-l10n_it_fatturapa_out_dn branch 2 times, most recently from 961fdea to ce6af3e Compare August 9, 2024 08:32
@TheMule71 TheMule71 force-pushed the 16.0-mig-l10n_it_fatturapa_out_dn branch from ce6af3e to 662c34e Compare October 21, 2024 12:59
@TheMule71

Copy link
Copy Markdown
Contributor Author

ValueError: External ID not found in the system: l10n_it.l10n_it_chart_template_generic

La modifica è stata introdotta con #4176. Per caso è cambiato qualcosa nell'ambiente di esecuzione dei test (e l10n_it non è più presente?)

In ogni caso prob. va fixato visto che non deve dipendere da l10n_it.

"NumeroDDT": delivery_note.name,
"DataDDT": delivery_note.date,
}
e_invoice_lines = self.get_e_invoice_lines(invoice)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ho cambiato questa parte così per mettere il riferimentonumerolinea solo se c'è più di un DN collegato e togliere le righe nota/sezione:

if len(invoice.delivery_note_ids) > 1:
    # RiferimentoNumeroLinea should not be populated
    # if all the lines of the invoice
    # are linked to this delivery_note
    e_invoice_lines = self.get_e_invoice_lines(invoice)
    e_invoice_delivery_note_lines = e_invoice_lines.filtered(
        lambda eil, delivery_note=delivery_note:
        eil.delivery_note_id == delivery_note and eil.display_type == 'product')

    e_invoice_lines_list = list(e_invoice_lines)
    lines_refs_list = [
        e_invoice_lines_list.index(line) + 1  # NumeroLinea is 1-based
        for line in e_invoice_delivery_note_lines
    ]

    ddt_data.update(
        {
            "_invoice_lines": e_invoice_delivery_note_lines,
            "RiferimentoNumeroLinea": lines_refs_list,
        }
    )

    dati_ddt_list.append(ddt_data)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Non seguo la logica, in che senso se len(invoice.delivery_note_ids) > 1 allora tutte le righe fattura sono collegate allo stesso DDT?
Potrebbero esserci righe che non sono collegate al DDT.

È vero che probabilmente la maggior parte delle volte non sarebbe un problema perché tali righe saranno magari per servizi e quindi va da sé che non riguardano il DDT. Però è una considerazione di pratica, in teoria nulla vieta questo scenario:

crei SO -> consegni -> crei DDT -> crei fattura
ora aggiungi uno o più prodotti alla fattura

prima avrebbe riportato nell'XML i riferimenti alle sole righe derivate del DDT;
se non sbaglio, con questa modifica, riporterebbe l'intera fattura riferita al quel DDT, e se uno va a cercare i prodotti aggiunti dopo in fattura nel DDT non li trova.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Non seguo la logica, in che senso se len(invoice.delivery_note_ids) > 1 allora tutte le righe fattura sono collegate allo stesso DDT?

No, collego solo quelle che appartengono ai DN come si vede in questo passaggio:

e_invoice_delivery_note_lines = e_invoice_lines.filtered(
        lambda eil, delivery_note=delivery_note:
        eil.delivery_note_id == delivery_note and eil.display_type == 'product')

se non sbaglio, con questa modifica, riporterebbe l'intera fattura riferita al quel DDT, e se uno va a cercare i prodotti aggiunti dopo in fattura nel DDT non li trova.

se committi queste modifiche le si può provare anche nel runboat e dovresti vedere che funziona
lo stiamo usando in produzione da un cliente, ho fatto un test con il flusso che hai indicato e correttamente la riga aggiunta post in fattura non viene collegata a DN

@TheMule71 TheMule71 Dec 13, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok, ma quello lo fai se len(invoice.delivery_note_ids) > 1.

Il caso che ho portato era per len(invoice.delivery_note_ids) == 1.

Rileggendo nel mio commento precedente non è chiaro, riformulo:

Non seguo la logica, in che senso se len(invoice.delivery_note_ids) == 1 allora tutte le righe fattura sono collegate allo stesso DDT?

@TheMule71 TheMule71 force-pushed the 16.0-mig-l10n_it_fatturapa_out_dn branch 2 times, most recently from 292aed2 to c02958d Compare December 12, 2024 15:27
@SirAionTech SirAionTech removed the needs fixing Has conflicts or is failing mandatory CI checks label Dec 18, 2024
@TheMule71 TheMule71 force-pushed the 16.0-mig-l10n_it_fatturapa_out_dn branch 2 times, most recently from 173564b to e3a0c81 Compare March 18, 2025 11:06
@TheMule71

Copy link
Copy Markdown
Contributor Author

Ok ho rivisto alcune cose, adesso delivery_note_id è popolato anche per le righe prodotto, per cui è possibile controllare quando aggiungere i riferimenti alle righe oppure no nella stanza DatiDDT

@TheMule71 TheMule71 force-pushed the 16.0-mig-l10n_it_fatturapa_out_dn branch 2 times, most recently from 5a4610b to 173564b Compare March 18, 2025 22:20
@TheMule71

TheMule71 commented Mar 18, 2025

Copy link
Copy Markdown
Contributor Author

Ok, come non detto, delivery_note_id NON è popolato per le righe prodotto.

Si torna a 173564b

l10n_it_delivery_note non è ancora pronto per la patch, ma ai suoi figli piacerà

@odooNextev

e_invoice_delivery_note_lines = e_invoice_lines.filtered(
        lambda eil, delivery_note=delivery_note:
        eil.delivery_note_id == delivery_note and eil.display_type == 'product')

è sempre vuoto.

@sergiocorato

Copy link
Copy Markdown
Contributor

(faccio minor perchè c'è un'aggiunta su altro modulo)
/ocabot merge minor

@OCA-git-bot

Copy link
Copy Markdown
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 16.0-ocabot-merge-pr-4054-by-sergiocorato-bump-minor, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Jan 15, 2026
Signed-off-by sergiocorato
@OCA-git-bot

Copy link
Copy Markdown
Contributor

@sergiocorato your merge command was aborted due to failed check(s), which you can inspect on this commit of 16.0-ocabot-merge-pr-4054-by-sergiocorato-bump-minor.

After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.

@sergiocorato

Copy link
Copy Markdown
Contributor

@TheMule71 manca una configurazione sul pagamento su un test, non so come non fosse stata rilevata prima, se puoi correggerla

@monen17

monen17 commented Jan 23, 2026

Copy link
Copy Markdown
Contributor

I test dovrebbero fallire anche qui nella PR se il codice fosse più aggiornato, lo aggiorno.
/ocabot rebase

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, PR rebased to 16.0.

@OCA-git-bot OCA-git-bot force-pushed the 16.0-mig-l10n_it_fatturapa_out_dn branch from 452456b to f031508 Compare January 23, 2026 17:45
@monen17

monen17 commented Jan 23, 2026

Copy link
Copy Markdown
Contributor

@TheMule71 puoi correggere i test? Altrimenti non si può mergiare

@monen17 monen17 added the needs fixing Has conflicts or is failing mandatory CI checks label Feb 2, 2026
@TheMule71 TheMule71 force-pushed the 16.0-mig-l10n_it_fatturapa_out_dn branch from f031508 to b54cd6a Compare March 23, 2026 09:54
This module adds DatiDDT section to e-invoices
@TheMule71 TheMule71 force-pushed the 16.0-mig-l10n_it_fatturapa_out_dn branch from b54cd6a to 679acc2 Compare March 23, 2026 10:42
@TheMule71

Copy link
Copy Markdown
Contributor Author

@TheMule71 manca una configurazione sul pagamento su un test, non so come non fosse stata rilevata prima, se puoi correggerla

Tra l'altro non ho ben capito come mai i test si sono rotti, erano verdi prima, deve essere cambiato qualcosa: magari check più aggressivi opppure un default che prima non c'era. Comunque ho impostato il metodo di pagamento corretto e aggiornato l'XML del test di conseguenza.

@monen17 monen17 removed the needs fixing Has conflicts or is failing mandatory CI checks label Mar 23, 2026

@monen17 monen17 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Grazie della PR!
Il modulo è stato mergiato in 14.0 con #2202 quindi questa è una migrazione, puoi riscrivere i commit come indicato in https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-16.0? Così è più chiaro cosa è cambiato da 14.0 a 16.0.

@monen17

monen17 commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

/ocabot migration l10n_it_fatturapa_out_dn

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone Mar 23, 2026
@OCA-git-bot OCA-git-bot mentioned this pull request Mar 23, 2026
81 tasks
@TheMule71 TheMule71 closed this Mar 23, 2026
@TheMule71 TheMule71 deleted the 16.0-mig-l10n_it_fatturapa_out_dn branch March 23, 2026 14:45
@TheMule71 TheMule71 restored the 16.0-mig-l10n_it_fatturapa_out_dn branch March 23, 2026 15:09
@TheMule71 TheMule71 deleted the 16.0-mig-l10n_it_fatturapa_out_dn branch March 23, 2026 15:10
@TheMule71

Copy link
Copy Markdown
Contributor Author

Veramente le due PR sono andate avanti in parallelo, tant'è che questa è stata creata un anno prima che l'altra venisse mergiata. I commit sono stati portati a mano.

Comunque si può simulare una migrazione e riportare le modifiche:

#5154

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

l10n_fatturapa_out: output delivery note data in XML