Skip to Content

The VAT return out of Odoo: from the journal entry to the validated XML

December 1, 2026 by
The VAT return out of Odoo: from the journal entry to the validated XML

In many companies the VAT return is done on the evening of the 24th, roughly like this: a report pulled out of the system, a spreadsheet alongside it, the figures keyed by hand into the ANAF application, and a check that happens if there is any time left.

The work itself is not the problem. The problem is that the path from the journal entry to the line in the return is nowhere visible. When a figure looks wrong — and sooner or later one does — there is no place to start looking.

Below, what the flow looks like when it is built into the system.

1. Everything starts from the VAT tags

The return is not computed from accounts, but from VAT tags. Every tax in Odoo leads, through its repartitions, to one or more tags — 01, 03_1, 09_1, 10_1 and so on — and every posted journal line carries the tags it is due.

The return reads the posted entries of the period, aggregates them by tag and carries the totals into its lines: from the first line through to the adjustment lines, plus the opening balances on accounts 4423 and 4424, the refund, the pro-rata payment and the period balance.

The practical consequence, and the reason the mechanism is worth understanding: any line of the return can be taken apart backwards. You filter the journal lines by that tag, over that period, and you have in front of you exactly the documents the figure was built from.

"Where do the 12,400 lei on line 9 come from?" becomes a search, not a discussion.

2. The period is derived on its own

The filing period is not the same for everyone: monthly for most companies, quarterly below the legal threshold, half-yearly or yearly for special regimes.

The return type is derived from the interval chosen in the wizard, together with the related checkboxes, so nobody has to remember which code goes where.

3. The schema version: the detail that saves a correction

ANAF periodically publishes new versions of the XSD schema for the D300. A return filed today, for last month, goes on the schema in force. But a corrective return for a month two years ago has to be filed on the schema of that time.

The module carries the published versions and picks the right one based on the period end date. It is the kind of thing nobody thinks about until the day something old has to be corrected — and then it matters a great deal.

4. Validation, before filing

The official ANAF validator, DUKIntegrator, is a Java program that comes with around 200 MB of libraries and with the ANAF schemas. It cannot be installed on just any infrastructure — on a platform with read-only addon paths, for instance, there is simply nowhere for it to live.

The answer is to install it once, on a dedicated server, and have Odoo ask it over HTTPS. That is what the validation module does: you put the service address and the key in the accounting settings, and a validate button appears in the declaration wizard.

You press it and find out on the spot whether the file passes, with the official PDF returned. You do not download the file, you do not open another application, you do not learn from ANAF that something is wrong.

5. What to check before filing

A short list, in the order that catches the most problems:

  1. All the documents of the period are posted. The return only reads posted entries. An invoice left in draft does not exist as far as it is concerned.
  2. Purchase invoices are recorded with the right tax, not with an "approximate" one. The tax leads to the tag, the tag leads to the line.
  3. Special operations — reverse charge, intra-Community acquisitions, imports — appear on their own lines. It is worth taking one of each and checking it individually, the first time you run the return.
  4. The opening balances on 4423 and 4424 match what you reported last month.
  5. The amount payable or recoverable matches the trial balance. If it does not, the difference is almost always a line without a tag or a tax configured wrongly.
  6. Validation passes. A schema error is fixed in five minutes now, and in three hours on the 25th at noon.

6. The link to the other returns

The VAT return does not live alone. Its figures have to match, on certain positions, those of the D394 and the D390 — and the differences between them are the first things ANAF checks.

All the returns start from the same base: the same declaration framework, the same documents, the same tags. That is not a happy coincidence, it is how they were built: one single source for all of them, instead of three reports each constructing its own truth.

In short

A good return is not the one filed quickly, but the one that can be explained. As long as every line has a path back to the document, the following month starts from zero problems rather than from the leftover ones.

The module is on Odoo Apps, for Odoo 19 and 20: Romania - Accounting Declarations.

If you want us to go through a return on your data together, before the next filing: nexterp.ro/contactus.

The VAT return out of Odoo: from the journal entry to the validated XML
December 1, 2026
Share this post
Archive