| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Invoicing (account)
• Discuss (mail) • Inventory (stock) |
| Community Apps Dependencies | Show |
| Lines of code | 4955 |
| Technical Name |
l10n_ro_declaration_D390 |
| License | OPL-1 |
| Website | https://www.nexterp.ro |
| Versions | 18.0 19.0 |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Invoicing (account)
• Discuss (mail) • Inventory (stock) |
| Community Apps Dependencies | Show |
| Lines of code | 4955 |
| Technical Name |
l10n_ro_declaration_D390 |
| License | OPL-1 |
| Website | https://www.nexterp.ro |
| Versions | 18.0 19.0 |
Romania - D390 ANAF Declaration
Romania - D390 ANAF Declaration
Overview
This module generates the D390 declaration (Declarația recapitulativă privind livrările/achizițiile/prestările intracomunitare) for Romanian ANAF. D390 is the monthly intra-Community recapitulative statement filed by every Romanian VAT-registered taxpayer that performs intra-Community operations of goods or services with partners established in other EU member states.
The declaration aggregates each operation by partner VAT number and
operation type: L — intra-Community supplies of goods, A —
intra-Community acquisitions of goods, P — intra-Community supplies of
services, S — intra-Community acquisitions of services, T —
triangular operations (intermediary in a chain), R — non-transfer
operations (own goods sent to / from another member state). A separate
section (cos) reports goods placed under the call-off stock
simplification (art. 17a Directive 2006/112/CE) — outbound transfers,
returns and partner replacements based on stock pickings.
Output is an XML conformant to the ANAF D390.xsd schema (versions 3 and
4.1 are bundled). The wizard cross-checks the L / A / P / S totals against
the D300 tax tag totals for the same period and raises a clear error if
the two do not reconcile — preventing the most common reason for ANAF
rejection.
Built & supported by NextERP Romania
Romanian Odoo specialists, here for the long run — from implementation to localization and day-to-day production support.
What we do
Odoo Solutions
From quick-start rollouts to multi-company deployments and custom modules built for your processes.
Romanian Localization
SAF-T (D406), e-Factura, e-Transport, D300 / D390 / D394, ANAF integration, full chart of accounts and fiscal positions.
Our Services
Implementation, customization, migration, integration, support and consultancy — Romanian-speaking, SLA-backed.
Features
- Monthly intra-Community recapitulative statement — wizard
l10n.ro.anaf.d390generates<declaratie390>under namespacemfp:anaf:dgti:d390:declaratie:v3, validated against the bundledD390.xsd. Two versions are shipped (v3,v4.1); the wizard picks the one matching the period. - Operation type detection — each posted invoice line is classified
as L (supplies of goods), A (acquisitions of goods), P (supplies of
services), S (acquisitions of services), T (triangular) or R
(non-transfer / specific products) based on its VAT tax tag, the
l10n_ro_is_triangularflag and the productl10n_ro_anaf_code. - Per-partner aggregation — lines are grouped by
(partner_vat, operation_type)and partner country is filled from_parse_anaf_vat_info(). The ANAFcodOcarries only the national part of the VAT number (the country prefix goes ontaraseparately). - D300 reconciliation —
check_intracom_vat()recomputes the L / A / P / S totals from the D300 tax tags and compares them to the D390rezumat; the wizard raises aUserErrorlisting the diverging partners if the two do not match within a rounding tolerance. - Triangular adjustments — lines with
l10n_ro_is_triangularare reclassified asT(sales) or excluded entirely (purchases), and the matching amounts are subtracted from the D300 totals during the cross-check to keep the comparison aligned. - Call-off stock (
cos) — stock pickings flag the three call-off scenarios (outbound transfer = tip A; return = tip B motiv 1; partner replacement = tip B motiv 2). The module addsl10n_ro_new_contactandl10n_ro_date_transfer_new_contactonstock.pickingto capture the replacement event. - Interactive report — the bundled
anaf_d390_report(account.report.custom.handler) lets accountants drill down from each<operatie>line into the source move lines before generating the XML. - Rectifying form — the
rectificativeflag on the wizard setsd_recin the XML for a corrective filing. - XSD validation before download — the output is checked against
D390.xsd; new schema versions are added as sibling submodules inmodels/v<N>/.
Configuration
1. Prerequisites
Complete the setup described in the l10n_ro_declaration base module shipped with this one:
- Romanian VAT/CUI on the company.
- At least one ANAF signature under Accounting → Configuration → Romania → ANAF Signatures.
- The company bank account, address, phone and e-mail.
2. Partners
For every partner involved in intra-Community operations:
- Country must be an EU member state (not Romania); the wizard uses
_get_l10n_ro_anaf_europe_codes()to validate. - A valid EU VAT number (with country prefix); the helper
_parse_anaf_vat_info()splits the country code from the numeric part to filltaraandcodO(ANAF requires the national part only — the prefix is reported separately). - For non-resident partners, mark them as
l10n_ro_partner_type = '3'(Intra-EU). The wizard filters lines to that partner type when computing operation L / A / P / S totals.
3. Tax tags
D390 reads the same Romanian VAT tags used by D300, restricted to the intra-Community lines:
| Tag | Operation |
|---|---|
01 - BAZA / 01 - TAX BASE |
L — intra-Community supplies of goods |
03_1 - BAZA / 03_1 - TAX BASE |
P — intra-Community supplies of services |
20_1 - BAZA / 20_1 - TAX BASE |
A — intra-Community acquisitions of goods |
22_1 - BAZA / 22_1 - TAX BASE |
S — intra-Community acquisitions of services |
Make sure every intra-EU sale and purchase tax used in your invoices
carries the correct tag through the standard ANAF tax report
(l10n_ro_account_enterprise).
4. ANAF product codes
For specific reverse-charge product categories (cereals, sugar, etc.)
operations are reported under type R. Set the corresponding
l10n_ro_anaf_code on the product so the wizard can detect them
(category code 21 triggers R; _is_R() in models/v3/d390_*.py).
5. Triangular operations (T)
Triangular operations (Romania as intermediary B in a chain A → B → C,
art. 268 alin.(8) lit. b Cod Fiscal) are flagged by the
l10n_ro_is_triangular field on the move line. Sales lines carrying that
flag are reported under operation type T; the matching acquisition
lines are excluded (they are not regular AIC under the triangular
regime). See TRIANGULAR_OPERATIONS.md in this readme folder for the
complete configuration walkthrough.
6. Call-off stock (cos)
The cos section reports goods placed under the call-off stock
simplification, reading data from stock pickings:
stock.picking._is_outbound_custody_transfer()— initial transfer (tip A).stock.picking._is_outbound_custody_return()— goods returning to RO (tip B, motiv 1).l10n_ro_new_contact+l10n_ro_date_transfer_new_contacton the picking — customer replacement (tip B, motiv 2). These fields are added by this module onstock.picking.
Custody locations must be configured under
l10n_ro_stock_custody (the dependency) before pickings can flow into
the cos section.
7. Wizard location
Open the wizard at Accounting → Reports → Romania → D390 Declaration.
After configuration, generate the declaration as described in USAGE.md.
How it works
D390 is exposed in two complementary ways:
- as an interactive report under
Accounting → Reports → Romania → D390 (the
anaf_d390_reportrecord), which lists every aggregated operation by partner and lets you drill down to the source invoices and pickings; - as a wizard under Accounting → Reports → Romania → D390 Declaration used to generate the ANAF XML file.

Steps
-
Header fields
- Declaration / Version — defaults to
D390 / Versiunea 4.1. - Date From / Date To — defaults to the previous calendar month (D390 is filed monthly, by the 25th of the following month).
- Signature — pick the ANAF signature configured for the declarant.
- Rectificativa — tick to emit the corrective form of a previously submitted D390.
- Declaration / Version — defaults to
-
Get Report — generates the XML, validates it against the ANAF
D390.xsdschema and attaches the file to the wizard for download. Internally:- The wizard collects every posted invoice in the period with
l10n_ro_partner_type = '3'(intra-EU partners). - For each move line it classifies the operation using the VAT tax
tags (
01→ L,03_1→ P,20_1→ A,22_1→ S), thel10n_ro_is_triangularflag (→ T) and thel10n_ro_anaf_codeproduct category (→ R). - Lines are aggregated by
(partner_vat, operation_type)and rounded. - A
rezumatblock sums all amounts by operation type (bazaL,bazaA,bazaP,bazaS,bazaT,bazaR,total_baza). - The
cosblock is built from outbound custody pickings (transfer / return / partner replacement).
- The wizard collects every posted invoice in the period with
-
D300 cross-check — before emitting the XML, the wizard recomputes the L / A / P / S totals from the D300 tax tags and compares them against the D390
rezumat. If the two do not match within a small rounding tolerance, aUserErroris raised listing the differing partners and amounts, so the discrepancy can be fixed in the source documents. -
Triangular adjustments — lines carrying the
l10n_ro_is_triangularflag are excluded or reclassified asT; the matching tag amounts are subtracted from the D300 totals during the cross-check to keep the comparison aligned. SeeTRIANGULAR_OPERATIONS.mdfor the full discussion. -
Validate with DUKIntegrator — run ANAF's local validator before signing.
-
Sign with the digital signature (Sectigo / certSIGN / other token).
-
Upload to ANAF at the Depunere declarații portal under D390.
Generated XML — key fields
- Root
<declaratie390>withluna,an,d_rec,totalPlata_A, taxpayer identification (cui,den,adresa,telefon,fax,mail) and declarer info (nume_declar,prenume_declar,functie_declar). - One
<rezumat>child withnrOPI(number of operators),bazaL,bazaT,bazaA,bazaP,bazaS,bazaR,total_baza,nr_pag. - One
<operatie>per(partner, type)combination withtara,codO,denO,tip(L/A/P/S/T/R),baza. - Optional
<cos>entries for call-off stock movements.
Operation types
| Code | Meaning | Source |
|---|---|---|
| L | Intra-Community supply of goods | Sale invoice line with tag 01 |
| A | Intra-Community acquisition of goods | Purchase invoice line with tag 20_1 |
| P | Intra-Community supply of services | Sale invoice line with tag 03_1 |
| S | Intra-Community acquisition of services | Purchase invoice line with tag 22_1 |
| T | Triangular operation | Sale invoice line with l10n_ro_is_triangular = True |
| R | Non-transfer / specific products | Product l10n_ro_anaf_code in category 21 |
Screenshots
Captured from a running Odoo instance.
Action run declaration390
Versions
19.0.0.2.0 (2026-05-24)
- Changelog tracking starts at this release.
Discover the NextERP suite
Other modules from the same publisher, built to work together.
NextERP Romania
Odoo implementation, customization, Romanian localization and long-term support since 2018.
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module