Skip to content

[18.0][ADD]l10n_it_edi_related_document_type: l10n_it_edi extension for multiple related document type management #4749

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 18.0
Choose a base branch
from

Conversation

matteonext
Copy link
Contributor

@matteonext matteonext commented May 8, 2025

Allows import and export of multiple related document types, similar to l10n_it_fatturapa. Also removes the read-only restriction on lineRef. Removes the invoice_line reference from the related document type model, as it is only needed in the report.
Hides l10n_it_edi fields from the invoice view, but keeps them available for import.

@matteonext matteonext force-pushed the 18.0-add-l10n_it_edi_document branch from 26f0293 to bdcf23f Compare May 8, 2025 12:57
@matteonext matteonext changed the title [18.0][ADD]l10n_it_edi_related_document_type [18.0][ADD]l10n_it_edi_related_document_type: l10n_it_edi extension for multiple related document type management May 8, 2025
@matteonext matteonext force-pushed the 18.0-add-l10n_it_edi_document branch 2 times, most recently from 6a0954b to d4c7a72 Compare May 8, 2025 13:14
Copy link
Contributor

@monen17 monen17 left a comment

Choose a reason for hiding this comment

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

Grazie della PR!
Come dicevo stamattina in chiamata, secondo me anche questo si potrebbe includere in l10n_it_edi_extension (#4411) perché non vedo grandi differenze tra questa funzionalità e la visualizzazione dell'anteprima, o le altre funzionalità già incluse in quel modulo.

Anche lasciarlo in un modulo a sé ha senso, ma allora potevamo farlo anche per le altre funzionalità 🤷

Quindi per me vanno bene entrambe le soluzioni.


Non ho visto script di migrazione, quindi se uno migra da 16.0 perde tutti i documenti collegati alle fatture?

@matteonext matteonext force-pushed the 18.0-add-l10n_it_edi_document branch 2 times, most recently from d691ce1 to 0e22e76 Compare May 12, 2025 14:56
@matteonext
Copy link
Contributor Author

@monen17 Grazie mille per la review! Seguendo le indicazioni e commenti nella task del portale Odoo Italia ho scelto di farlo in un modulo separato. Non ci sarebbero comunque problemi ad aggiungere le funzionalità in l10n_it_edi_extension.
Al momento non ho aggiunto lo script di migrazione, lo posso aggiungere nei prossimi giorni per evitare di perdere i documenti collegati alle fatture.

@matteonext matteonext force-pushed the 18.0-add-l10n_it_edi_document branch from ba46619 to 6cf4ab5 Compare May 15, 2025 11:41
@matteonext matteonext requested a review from monen17 May 15, 2025 11:45
Copy link
Contributor

@monen17 monen17 left a comment

Choose a reason for hiding this comment

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

Grazie delle modifiche!
Oltre ai punti ancora aperti qui sotto, manca ancora lo script di migrazione.

Ah e ricorda di modificare anche il messaggio del commit visto che il nome del modulo è cambiato.

@matteonext matteonext force-pushed the 18.0-add-l10n_it_edi_document branch 2 times, most recently from 190129c to fbc1827 Compare May 23, 2025 12:05
@matteonext
Copy link
Contributor Author

@monen17 Grazie anche per questa review! Ho aggiornato la pr per gestire il collegamento tra le righe di fattura e i documenti collegati, sia in import xml che nel create.
Ho aggiunto anche lo script di migrazione.

@matteonext matteonext requested a review from monen17 May 23, 2025 15:22
Copy link
Contributor

@monen17 monen17 left a comment

Choose a reason for hiding this comment

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

Ho fatto solo revisione del codice e secondo me manca solo più qualche piccola modifica; non ho modo di verificare la migrazione ma a occhio mi sembra ok.

def create(self, vals_list):
line_obj = self.env["account.move.line"]
for vals in vals_list:
if vals.get("lineRef") and not vals.get("invoice_line_id"):
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if vals.get("lineRef") and not vals.get("invoice_line_id"):
if vals.get("lineRef") and not vals.get("invoice_line_id") and vals.get("invoice_id"):

Altrimenti quando più sotto fai vals["invoice_id"] potrebbe essere sollevato un KeyError.

Comment on lines +25 to +26
invoice_doc_type = related_document.filtered(lambda x: x.type == "invoice")[0]
rcp_doc_type = related_document.filtered(lambda x: x.type == "reception")[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

Si potrebbe verificare per almeno un documento che è collegato alla riga corretta?

<field name="cup" />
</group>
<group groups="base.group_no_one">
<field name="invoice_id" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<field name="invoice_id" />
<field name="invoice_id" />
<field name="invoice_line_id" />

Ora che è tornato, potrebbe essere utile vederlo.

@matteonext matteonext force-pushed the 18.0-add-l10n_it_edi_document branch from fbc1827 to 0a90443 Compare May 28, 2025 14:35
@matteonext matteonext requested a review from monen17 May 29, 2025 06:34
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.

3 participants