Declaration of Intent for Italy (OCA)
English
This module extends the functionality of l10n_it_edi_doi, enabling the use of the Declaration of Intent (Dichiarazione di Intento) for incoming vendor bills and purchase orders.
Key features:
- Support for multiple Declarations of Intent per invoice
- Dedicated tab in invoice form for managing DOI associations
- Automatic validation of DOI amounts and available thresholds
- Smart warnings when invoice amounts don't match DOI coverage
- Backward compatibility with single-declaration workflow
- Check that the move lines only include the DoI Tax, when present
- Check that at least one move line contains the DoI Tax when the DoI is set in the Move
- In the Company form, only find Purchase/Sale Taxes of the shown Company for issued/received Declarations
Italiano
Questo modulo estende la funzionalità di l10n_it_edi_doi, permettendo l'utilizzo della Dichiarazione di Intento per le fatture di acquisto in ingresso e gli ordini di acquisto.
Caratteristiche principali:
- Supporto per dichiarazioni di intento multiple per fattura
- Tab dedicato nel form fattura per gestire le associazioni DOI
- Validazione automatica degli importi e soglie disponibili
- Avvisi intelligenti quando gli importi non corrispondono
- Retrocompatibilità con il flusso a dichiarazione singola
- Verifica che i movimenti contabili includano soltanto l'imposta per la DI, quando presente
- Verifica che almeno un movimento contabile contenga l'imposta per la DI quando la DI è impostata nella registrazione
- Nel form dell'azienda, trova solo le imposte di acquisto/vendita dell'azienda mostrata per le dichiarazioni emesse/ricevute
auto_awesome What this module does
AI-generated from the code · Odoo 18.0Lets Italian companies apply Declarations of Intent to vendor bills and purchase orders, including several declarations on one bill, with automatic checks that the special tax and the covered amounts are consistent.
This module extends the Italian Declaration of Intent (Dichiarazione d'Intento) feature so it also works on the purchasing side, not only on sales.
On a vendor bill, a new "Declarations of Intent" tab appears (only when the declaration feature applies). There you can link one or several declarations to the bill and enter the amount each one covers. The tab shows the bill's declaration amount and the total covered by all linked declarations. If the covered total is lower than the bill amount, a warning message explains the gap. When you post the bill, Odoo blocks it if the special declaration tax is used without a declaration, if a declaration is linked but no line carries that tax, or if a line mixes the declaration tax with other taxes.
On a purchase order, a Declaration of Intent field appears next to the fiscal position, with a button to open the declaration and a warning banner about validity or threshold problems. Odoo proposes a valid declaration automatically for Italian partners. Sending the request for quotation or confirming the order is blocked when the declaration is invalid or the special tax is used without a declaration. When the order is invoiced, the declaration is carried over to the bill.
Declarations now have a type (issued by the company or received from customers), an internal sequence number, and lists of linked purchase orders and invoice lines. Their invoiced and not-yet-invoiced amounts take purchase orders and the per-bill amounts into account. A declaration used on a purchase order cannot be deleted.
In company settings you choose the purchase tax and the sales tax used for declarations; the purchase one cannot be deleted. A "Declarations of intent" menu is added under Accounting.
Depends on
Required by other modules
Menus it adds
Models and fields (5)
- res.company · extends an existing modell10n_it_edi_doi_tax_id, l10n_it_edi_doi_bill_tax_id (Declaration of Intent Bills Tax)
- account.move · extends an existing modeldoi_type, l10n_it_edi_doi_ids (Declarations of Intent), l10n_it_edi_doi_count (DOI Count), l10n_it_edi_doi_total_amount (Total DOI Amount)
- purchase.order · extends an existing modell10n_it_edi_doi_id (Declaration of Intent), l10n_it_edi_doi_use (Use Declaration of Intent), l10n_it_edi_doi_date (Date on which Declaration of Intent is applied), l10n_it_edi_doi_warning (Declaration of Intent Threshold Warning), l10n_it_edi_doi_not_yet_invoiced (Declaration of Intent Amount Not Yet Invoiced)
- account.move.doi · new modelamount, move_id (Invoice), sequence, company_id, currency_id, declaration_id (Declaration of Intent), declaration_end_date (End Date), declaration_invoiced (Already Invoiced), declaration_available (Available), declaration_threshold (Threshold), protocol_number_part1 (Protocol 1), protocol_number_part2 (Protocol 2), declaration_issue_date (Issue Date), declaration_start_date (Start Date)
- l10n_it_edi_doi.declaration_of_intent · extends an existing modeltype, number, move_doi_ids (Invoice Declaration Lines), purchase_order_ids (Purchase / Rfq Orders)
Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. The module is very large and only part of the code was read. View the code on GitHub
Availability by version
Reviewed: 2026-11-03Confirmation status: 1 confirmed, 8 with no information of 9 versions.
Sources · Odoo 18.0
Confirmed on 2026-11-03 in branch 18.0 of OCA/l10n-italy.
terminal Installation and usage
OCA documentation · Odoo 18.0Installation
Source · Odoo 18.0English
Migration from l10n_it_declaration_of_intent (Odoo 16)
If the module l10n_it_declaration_of_intent is installed, the migration runs automatically when installing l10n_it_edi_doi_extension. No manual SQL or scripts are required.
Prerequisites:
- Back up the database before starting
- The
openupgradelibPython library must be installed in the Odoo environment
Steps:
- Back up the database.
- Install the module: The pre-init hook runs automatically and handles:
- Renaming of the old table and model
- Splitting
telematic_protocolintoprotocol_number_part1/protocol_number_part2 - Renaming fields (
date→issue_date,date_start→start_date, etc.) - Mapping states (
valid→active,expired→terminated,close→revoked) - Removing old views incompatible with Odoo 18 The post-init hook:
- Creates
account.move.doibridge records from the old many2many relations - Populates
l10n_it_edi_doi_amounton invoices that had no DOI tax lines - Cleans up residual metadata from the old module and removes it entirely (records, model metadata, and module entry — no manual uninstall is needed or possible after this point)
- Verify the migrated data:
- Declarations appear in the new menu with correct protocol numbers
- States are correctly mapped
- Invoice links are working
- Computed amounts (invoiced, remaining) are shown correctly
- For invoices that had multiple declarations in v16: check the "Declarations of Intent" tab and assign the correct amount to each entry (they are migrated with
amount = 0)
Data that is NOT migrated (no equivalent in v18):
partner_document_number,partner_document_datetaxes_ids,fiscal_position_id- Declaration lines (
declaration_linemodel) - Yearly limits (
yearly_limitmodel) — adjust individual declaration thresholds manually
Troubleshooting:
- ValidationError about repartition lines during installation: the migration script automatically adds missing repartition lines to split payment group taxes. If the error persists, check that
openupgradelibis installed correctly. - Duplicate key error on fiscal positions or taxes during l10n_it_edi_doi installation: this can happen when the old module had already created the same fiscal position data. The installation of
l10n_it_edi_doimay fail or show a warning. Remove the duplicate fiscal position tax mappings manually and retry. - Invoice DOI amount shows 0 or an approximate value: in the normal migration path,
l10n_it_edi_doi_amountis derived from the sum of the v16 declaration line amounts (accurate). If the declaration lines table was already absent at migration time, the fallback usesABS(amount_untaxed)as an approximation. If you see zero amounts, open each affected invoice and assign the correct amount in the "Declarations of Intent" tab. - Yearly limits not migrated: the concept no longer exists in v18. Review each declaration and set the
thresholdfield to the appropriate value.
Italiano
Migrazione da l10n_it_declaration_of_intent (Odoo 16)
Se il modulo l10n_it_declaration_of_intent è installato, la migrazione avviene automaticamente durante l'installazione di l10n_it_edi_doi_extension. Non è necessario eseguire script o SQL manualmente.
Prerequisiti:
- Eseguire un backup del database prima di iniziare
- La libreria Python
openupgradelibdeve essere installata nell'ambiente Odoo
Passi:
- Eseguire un backup del database.
- Installare il modulo: L'hook pre-init viene eseguito automaticamente e gestisce:
- Rinomina della tabella e del modello
- Split di
telematic_protocolinprotocol_number_part1/protocol_number_part2 - Rinomina dei campi (
date→issue_date,date_start→start_date, ecc.) - Mappatura degli stati (
valid→active,expired→terminated,close→revoked) - Rimozione delle view del vecchio modulo incompatibili con Odoo 18 L'hook post-init:
- Crea i record bridge
account.move.doidalle vecchie relazioni many2many - Popola
l10n_it_edi_doi_amountsulle fatture prive di righe con imposta DOI - Pulisce i metadati residui del vecchio modulo e lo rimuove completamente (record, metadati del modello e voce del modulo — non è necessaria né possibile una disinstallazione manuale)
- Verificare i dati migrati:
- Le dichiarazioni compaiono nel nuovo menu con i numeri di protocollo corretti
- Gli stati sono correttamente mappati
- I collegamenti alle fatture funzionano
- Gli importi calcolati (fatturato, residuo) sono visualizzati correttamente
- Per le fatture che avevano più dichiarazioni in v16: controllare il tab "Dichiarazioni di Intento" e assegnare l'importo corretto a ciascuna voce (vengono migrate con
amount = 0)
Dati NON migrati (nessun equivalente in v18):
partner_document_number,partner_document_datetaxes_ids,fiscal_position_id- Righe della dichiarazione (modello
declaration_line) - Limiti annuali (modello
yearly_limit) — aggiustare manualmente la soglia delle singole dichiarazioni
Risoluzione dei problemi:
- ValidationError sulle repartition lines durante l'installazione: lo script di migrazione aggiunge automaticamente le repartition lines mancanti sulle imposte di gruppo per lo split payment. Se l'errore persiste, verificare che
openupgradelibsia installato correttamente. - Errore di chiave duplicata su posizioni fiscali o imposte durante l'installazione di l10n_it_edi_doi: può accadere se il vecchio modulo aveva già creato gli stessi dati di posizione fiscale. L'installazione di
l10n_it_edi_doipuò fallire o mostrare un avviso. Rimuovere manualmente le mappature di posizione fiscale duplicate e riprovare. - Importo DI sulla fattura a 0 o approssimativo: nel percorso di migrazione normale,
l10n_it_edi_doi_amountviene derivato dalla somma degli importi delle righe di dichiarazione v16 (valore esatto). Se la tabella delle righe era già assente al momento della migrazione, il fallback usaABS(amount_untaxed)come approssimazione. Se si riscontrano importi a zero, aprire le fatture interessate e assegnare l'importo corretto nel tab "Dichiarazioni di Intento". - Limiti annuali non migrati: il concetto non esiste in v18. Rivedere ogni dichiarazione e impostare il campo
thresholdcon il valore appropriato.
Usage
Source · Odoo 18.0English
In the company configuration, it is necessary to define a dedicated tax for the Declaration of Intent for incoming vendor bills.
In the contacts, you can create a Declaration of Intent by choosing between two types:
- "Issued from company": for declarations issued by the company.
- "Received from customers": for declarations received from suppliers.
Multiple Declarations of Intent:
When creating or editing a vendor bill, you can now associate multiple Declarations of Intent:
- Go to the "Declarations of Intent" tab in the invoice form
- Add one or more declarations using the list
- For each declaration, specify the amount to be covered
- The module will automatically:
- Validate that amounts don't exceed available thresholds
- Show a warning if total DOI amounts don't match invoice amount
- Update the invoiced amounts on each declaration
- Generate protocol numbers in the XML export
You can also use the traditional single-declaration field for backward compatibility, or mix both approaches for different invoices.
Italiano
Nella configurazione dell'azienda è necessario definire un'imposta dedicata alla Dichiarazione di Intento per le fatture in ingresso. Nei contatti è possibile creare una Dichiarazione di Intento scegliendo tra due tipologie:
- "Issued from company": per le dichiarazioni emesse dall'azienda.
- "Received from customers": per le dichiarazioni ricevute dai fornitori.
Dichiarazioni di Intento Multiple:
Durante la creazione o modifica di una fattura fornitore, è ora possibile associare più Dichiarazioni di Intento:
- Accedi al tab "Dichiarazioni di Intento" nel form della fattura
- Aggiungi una o più dichiarazioni usando la lista
- Per ogni dichiarazione, specifica l'importo da coprire
- Il modulo automaticamente:
- Valida che gli importi non superino le soglie disponibili
- Mostra un avviso se il totale DOI non corrisponde all'importo fattura
- Aggiorna gli importi fatturati su ogni dichiarazione
- Genera i numeri di protocollo nell'esportazione XML
È possibile continuare ad usare il campo tradizionale a dichiarazione singola per retrocompatibilità, o combinare entrambi gli approcci per fatture diverse.
No verified information in OCA: Configuration.
Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.
Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.