Skip to main content
VeriFactu

NIF confirmation error when switching environment in VeriFactu

The message appears when you press Switch Environment and the NIF you typed to confirm differs from the company NIF, ignoring upper or lower case and spaces at the ends. To fix it, type exactly the NIF the message shows in quotation marks and press the button again.

FlexigoTech · Editor in charge: Víctor Gómez · Updated 5 November 2026

Key facts

Module
VeriFactu
Versions
Odoo 17, 18, 19 and 20
Checked
in the module's source code, version 20.0 · against the sources linked at the end
Reading time
4 min

The message and where it appears

The VeriFactu environment switch window asks you to confirm the NIF before the environment changes. If what you type does not match, pressing Switch Environment stops the action and shows: NIF confirmation does not match company NIF "…". Please type the exact NIF to confirm the environment switch. In place of the ellipsis, the module prints the NIF it compared against.

The text is in the published code for Odoo 17, 18, 19 and 20, and the Switch Environment button is always visible in all four versions.

Code-generated diagram, not an Odoo screen: the switch environment button at the top and the NIF confirmation message below it
Code-generated diagram based on the module's published code: the button and the message with the original code text, in Odoo 17, 18, 19 and 20.

With Odoo in Spanish, the message reads as in the second diagram.

Code-generated diagram, not an Odoo screen: the same NIF confirmation message in Spanish and in Catalan
Code-generated diagram based on the module's published translations: the message in Spanish (El NIF de confirmación no coincide con el NIF de la empresa "…". Escriba el NIF exacto para confirmar el cambio de entorno.) and its Catalan version.

What the button does not tell you

It appears when you press the button, and only then

The message is raised by the action behind the Switch Environment button when the condition below is met. It is the response to pressing the button: do not attribute it to opening the window or to saving some other record.

The NIF check comes before any change

The first thing the action does is compare the NIF. Only if it matches does it look at the environment you picked: if that is the one the company already has, it closes the window and changes nothing; if it is a different one, it makes the switch. So the message can appear even when you pick the environment the company is already on: the comparison happens before that is looked at.

It compares against the company NIF, and the message shows it to you

As the expected NIF, the module takes the NIF stored for the company and trims the spaces from both ends. That is the value shown in quotation marks in the message, so there is no need to guess it: read it from there.

Case and spaces at the ends do not count; everything else does

Both what you type and the expected NIF are converted to upper case and stripped of leading and trailing spaces before they are compared. A lower-case letter therefore does not trigger the error. Any other difference does: an extra or missing character, a space in the middle or a hyphen that is not in the expected NIF.

If it fails, the environment does not change

The message stops the action, and with it whatever was about to change: nothing is saved and the company stays on the environment it had. You can correct what you typed and press Switch Environment again.

If it matches, there are two outcomes

If the environment you picked is the one the company already has, the window closes without showing any notice. If it is different, the switch goes through a single route, the company's own, and you see the notice Environment Switched with the text AEAT environment switched to "…".. The module also writes a line to the server log with the company, the environment and the user who switched it.

How to resolve it

  1. Read the NIF the message shows in quotation marks: it is the value your entry was compared against.
  2. If it is your company's NIF, type it exactly as shown to confirm (upper or lower case makes no difference) and press Switch Environment again.
  3. If it is not your company's NIF, the value it is compared with is not the right one: review the company's NIF before trying again.
  4. Check the result: the Environment Switched notice means the switch has been made. If the window closes with no notice, the environment you had picked was already the company's.

Carrying on with the module

Another message in the module with its condition in the code is the one about the SIF manager when retrying submissions, and what the module adds to invoices is covered in this overview of fields and buttons. If you are implementing Odoo and want to review how the environment switch will work before you start invoicing, FlexigoTech implements Odoo 17, 18, 19 and 20 and builds custom connectors and integrations.

The module is published on Odoo Apps for 17.0, 18.0, 19.0 and 20.0.

Keep reading

What VeriFactu España adds to the Odoo invoice and when it actsThe fields VeriFactu España adds to the Odoo invoice, when it creates the record on posting and how to check it has acted, step by step.«Only a SIF Manager can retry AEAT submissions.»: when it appears and what to doWhat the VeriFactu message «Only a SIF Manager can retry AEAT submissions.» means in Odoo: when it appears, which buttons trigger it and how to fix it.What the Generate Export button in VeriFactu España does in OdooWhat the Generate Export button in VeriFactu España for Odoo does: who can see it, what each export type produces and the event it logs.
Checked in the module's source code (version 20.0) and the linked sources

Sources