Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. Localisation
  3. Romania - D406 ANAF Declaration v 19.0
  4. Sales Conditions FAQ

Romania - D406 ANAF Declaration

by NextERP Romania https://www.nexterp.ro
Odoo

$ 14425.00

v 19.0 Third Party
This module requires Odoo Enterprise Edition.
Apps purchases are linked to your Odoo account, please sign in or sign up first.
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies • Invoicing (account)
• Discuss (mail)
• Inventory (stock)
• Accounting (accountant)
Community Apps Dependencies Show
• Romania - ANAF Declaration
• Romania - Account Enterprise
• NextERP Base
Lines of code 4872
Technical Name l10n_ro_declaration_D406
LicenseOPL-1
Websitehttps://www.nexterp.ro
Versions 18.0 19.0
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies • Invoicing (account)
• Discuss (mail)
• Inventory (stock)
• Accounting (accountant)
Community Apps Dependencies Show
• Romania - ANAF Declaration
• Romania - Account Enterprise
• NextERP Base
Lines of code 4872
Technical Name l10n_ro_declaration_D406
LicenseOPL-1
Websitehttps://www.nexterp.ro
Versions 18.0 19.0
  • Description
  • License
Romania - D406 ANAF Declaration icon

Romania - D406 ANAF Declaration

Romania - D406 ANAF Declaration

v 19.0.2.1.16 LocalisationOPL-1
  • Overview
  • Features
  • Configuration
  • How it works
  • Versions

Overview

This module generates the D406 declaration (Standard Audit File for Tax, SAF-T) for Romanian ANAF. SAF-T is the OECD-standard XML export of the taxpayer's accounting, master data and operational records that Romanian companies must submit to ANAF — monthly for large and medium-size taxpayers, quarterly for small taxpayers, and on demand for non-resident entities registered for VAT in Romania.

A single D406 file contains the chart of accounts, the customer and supplier master data, the products and stock items, all journal entries posted in the period, every invoice and payment with full detail, the fixed-assets register (annual file) and the inventory balance (annual file). The Romanian SAF-T schema is Ro_SAFT_Schema_v249_2025.xsd — namespace mfp:anaf:dgti:d406:declaratie:v1.

The wizard reads the Odoo general-ledger report for the selected period, renders the QWeb template l10n_ro_declaration_D406.saft_template with all required sections, post-processes the output to add the nsSAFT: namespace prefix and the xsi:schemaLocation attribute, then attaches the resulting XML to the wizard for download. Three filing variants are supported: Declaration (monthly / quarterly transactional file), Stocks (annual inventory) and Assets (annual fixed-assets file).


NextERP Romania

Built & supported by NextERP Romania

Romanian Odoo specialists, here for the long run — from implementation to localization and day-to-day production support.

10+
Years of Odoo experience per team member
80%+
of Romanian Localization maintained on Odoo Apps
19.0
Tracking every Odoo major release

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

  • SAF-T (Standard Audit File for Tax) — wizard l10n.ro.anaf.d406 generates <nsSAFT:AuditFile> under namespace mfp:anaf:dgti:d406:declaratie:v1, validated against Ro_SAFT_Schema_v249_2025.xsd.
  • Three filing variants — toggle include_stocks / include_assets on the wizard to switch between (1) the monthly / quarterly transactional declaration, (2) the annual stock report and (3) the annual fixed-assets report. The selected variant drives the l10n_ro_saft_required_sections option used by the underlying l10n_ro_saft engine.
  • Rectificative filings — the rectificative flag sets the l10n_ro_rectificative option, marking the file as a corrective submission.
  • Partner SAF-T codes precomputed — res.partner.l10n_ro_saft_code is a stored compute that builds the 2-digit ANAF code (00 Romanian company with valid CUI, 03 Romanian taxpayer without CUI, 04 unidentified RO, 01 EU with VIES-valid VAT, 02 other foreign with VAT, 05/06 EU/foreign without VAT, 08 unknown) followed by the resolved VAT identifier. A SQL-only pre-init hook seeds the field on install to avoid hour-long computes on large partner bases.
  • Manual SAF-T code refresh — the Recompute Ro SAFT Code server action (added to the partner list) re-runs the Python compute for picked partners.
  • Tax entity classification — res.company.l10n_ro_tax_entity (Company / Division / Branch) drives the SAF-T Header block; configured under Settings → Accounting → Romanian Localization.
  • General-ledger driven — build_file() calls account.general.ledger.report.handler with a custom-range option; the QWeb template emits all SAF-T tables (Header, MasterFiles, GeneralLedgerEntries, SourceDocuments, optional Assets / Inventory).
  • Streaming-friendly XML rewriting — to support files up to hundreds of megabytes the wizard rewrites the namespace prefix with a single regex pass over the rendered string instead of reparsing with lxml (which previously took 100+ seconds on a 47 MB output and scaled poorly).
  • Error surfacing — actionable errors from the SAF-T engine are shown via the account.report.file.download.error.wizard so the accountant can fix the source data before resubmitting.
  • Bank account override — the saft_report.xml patches the standard l10n_ro_saft company header template so every IBAN / account number is emitted, addressing ANAF's requirement that the full list of company bank accounts be reported.

Configuration

1. Prerequisites

Complete the setup described in the l10n_ro_declaration and l10n_ro_saft base modules shipped with this one:

  • Romanian VAT/CUI on the company.
  • The CAEN code on the company record.
  • The chart of accounts must be the OMF 1802/2014 PCG RO (l10n_ro_account_enterprise).
  • All bank accounts of the company configured under Accounting → Configuration → Bank Accounts.
  • The fiscal-position mappings and the standard VAT tax tags configured.

2. Tax entity

Set the company's SAF-T tax entity at Settings → Accounting → Romanian Localization → Romania - Company tax entity:

Value When to use
Company Default — independent Romanian legal entity
Division A division reported separately under a parent
Branch reference A branch reporting under the parent's CUI

This drives the SAF-T Header.TaxAccountingBasis block.

3. Partner SAF-T codes

The 2-digit SAF-T partner code is computed automatically from country, VAT number, VIES validity and is_company. On module installation a SQL pre-init hook (hooks.py) seeds l10n_ro_saft_code on every partner so the first install completes in seconds even on databases with hundreds of thousands of partners.

To refresh codes manually after data corrections:

  1. Select the partners in the Contacts list.
  2. Use the Action → Recompute Ro SAFT Code server action.
Code Meaning
00 Romanian company with valid CUI
01 EU company with VIES-valid VAT
02 Non-EU foreign with VAT
03 Romanian taxpayer without CUI
04 Unidentified Romanian
05 EU without VIES-valid VAT
06 Non-EU foreign without VAT
08 Unknown country

4. SAF-T sections expected for your file

The wizard supports three variants:

  • Declaration (monthly / quarterly) — chart of accounts, partner master data, products, journal entries, invoices, payments.
  • Stocks (annual) — inventory balance per warehouse and location.
  • Assets (annual) — fixed-assets register with depreciation schedules.

Make sure the corresponding Odoo records (stock valuations, fixed assets) are complete for the period if you intend to file Stocks or Assets.

5. Wizard location

Open the wizard at Accounting → Reports → Romania → D406 Declaration.

After configuration, generate the declaration as described in USAGE.md.

How it works

Open Accounting → Reports → Romania → D406 Declaration.

D406 wizard

Steps

  1. Header fields

    • Declaration / Version — defaults to D406 / Versiunea 1.
    • Date From / Date To — set the period:
      • one calendar month for monthly filers,
      • one quarter for quarterly filers,
      • the full fiscal year for the annual Stocks / Assets files.
    • Signature — pick the ANAF signature configured for the declarant.
    • Bank Account — the company bank account printed in the file.
  2. Variant flags

    • Rectificative — tick to mark the file as a corrective submission (sets l10n_ro_rectificative on the SAF-T options).
    • Include Stocks — tick to generate the annual stocks file. The wizard then emits only the inventory sections.
    • Include Assets — tick to generate the annual fixed-assets file. The wizard emits only the assets sections.

    Leave both off to produce the regular monthly / quarterly transactional declaration.

  3. Get Report — builds the XML. Internally the wizard:

    • Opens the general-ledger report with a custom date range covering the wizard period.
    • Computes the SAF-T required-sections list based on the variant flags (monthly / stocks / assets).
    • Calls _l10n_ro_saft_prepare_report_values() and renders the l10n_ro_declaration_D406.saft_template QWeb template with the prepared values.
    • Post-processes the rendered string with a regex pass that prepends the nsSAFT: prefix to every element tag and rewrites the root <AuditFile> to add xmlns:nsSAFT, xmlns:xsi and xsi:schemaLocation pointing at Ro_SAFT_Schema_v249_2025.xsd.
    • Prepends the <?xml version="1.0" encoding="UTF-8"?> declaration and attaches the file to the wizard for download.
  4. Handling errors — if the SAF-T engine reports actionable errors (missing partner data, unbalanced moves, undistributed earnings, …) the wizard opens the standard account.report.file.download.error.wizard listing them next to the partial file. Fix the underlying records and regenerate.

  5. Validate with DUKIntegrator — D406 is large (hundreds of MB on year-end Assets files); run the validator with sufficient memory.

  6. Sign with the digital signature (Sectigo / certSIGN / other token).

  7. Upload to ANAF at the Depunere declarații portal under D406.

Generated XML — main sections

The output is a single <nsSAFT:AuditFile> containing:

  • Header — taxpayer identification, software identification, tax accounting basis, currency, period start/end, declaration variant (monthly / quarterly / annual / corrective).
  • MasterFiles — chart of accounts (with PCG RO codes), customers and suppliers (each carrying l10n_ro_saft_code), tax table, UoM table, products, owners, analysis types — depending on variant.
  • GeneralLedgerEntries — every journal entry posted in the period (monthly / quarterly variant only).
  • SourceDocuments — sales invoices, purchase invoices, payments, movement of goods (monthly / quarterly variant only).
  • Assets — fixed-assets register with acquisitions, disposals, depreciation by period (annual Assets variant only).
  • Inventory — stock balance by warehouse, location, product (annual Stocks variant only).

File-size notes

Real D406 files range from a few MB for small taxpayers up to several hundred MB for medium-sized companies and several GB for large ones. The XML post-processing uses a regex over the rendered string instead of lxml.etree.fromstring to keep memory and time linear in the output size.

Versions

19.0.2.1.16 (2026-05-24)

  • Changelog tracking starts at this release.

Discover the NextERP suite

Other modules from the same publisher, built to work together.

RO
Romania - ANAF Declaration
Localisation

Romania - ANAF Declaration

RO
Romania - ANAF Declaration DUKIntegrator
Localisation

Validate ANAF declarations against the NextERP DUKIntegrator HTTP service.

RO
Romania - Account Report Purchase Journal
Localisation

Romania - Account Report Purchase Journal

RO
Romania - Account Report Sale Journal
Localisation

Romania - Account Report Sale Journal

RO
Romania - D100 / 710 ANAF Declaration
Localisation

Romania - D100 / 710 ANAF Declaration

RO
Romania - D101 ANAF Declaration
Localisation

Romania - D101 ANAF Declaration

RO
Romania - D120 ANAF Declaration
Localisation

Romania - D120 ANAF Excise Duties Declaration (Decont privind accizele).

RO
Romania - D300 ANAF Declaration
Localisation

Romania - D300 ANAF Declaration

NextERP Romania

Odoo implementation, customization, Romanian localization and long-term support since 2018.

nexterp.ro
All apps
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

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author or have a question related to your purchase, please use the support page.
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with