The text and its section
The AEAT writes it like this: «No debe informarse como primer registro, existen facturas emitidas con el obligado emisión y el sistema informático actual.» In English: it must not be flagged as the first record, because invoices from this issuer with the current invoicing system already exist. It belongs to the section of errors that accept the record and ask for a correction. The validation document lists it among the admissible errors: PrimerRegistro set to S when there are already records for that system and that tax ID.

When Odoo flags a first record
Every record carries an Encadenamiento (chaining) block. The module fills it in one of two ways:
- If the record has no previous hash, it sends PrimerRegistro set to S. That happens with the first record of that company's chain in that Odoo database.
- In any other case it sends RegistroAnterior, with the tax ID, number, date and hash of the record before it.
The chain lives in the database: each company has one, and the module identifies each installation with its own NumeroInstalacion, computed from the database and the company. A new database starts its chain from scratch, and its first invoice goes out as a first record.

What is usually behind it
Error 2007 tells you that, as far as the AEAT knows, this issuer had already sent invoices with this same software before the chain you are using began. These are the questions worth asking:
- Have invoices of this company been sent from another Odoo database with the same module and to the same AEAT environment? A test copy configured for Production, for example.
- Did you switch databases halfway, through a migration or a restore, so that the new one started its own chain?
- Is the Genesis Record shown in Chain State the invoice you expected to be the first one?
If any answer is yes, there are two chains for the same issuer, and it is worth stopping it before you keep invoicing from both. Every new invoice coming out of the second chain will be linked to its own start, not to the first chain's, and the mismatch carries over.
How to close it
The invoice with the 2007 is registered. In Odoo it shows as «Aceptado con errores (subsanar)», accepted with errors to be corrected, and the AEAT asks for a correction through a new record with the same invoice identifier. The published module does not send correction records on its own, so write to comercial@flexigobe.com with the company name, the Genesis Record and the databases that have been sending invoices: we will sort it out with you.
For the other chaining codes, such as a badly filled previous record or hashes with the wrong length, see the chaining page.
Keep reading
Checked in the module's source code (version 20.0) and the linked sources
Sources
- www.agenciatributaria.es/static_files/AEAT_Desarrolladores/EEDD/IVA/VERI-FACTU/Validacione
- Module source code: flexigo_spain_verifactu 20.0 (aa2ea3d2): models/verifactu_aeat_client.py
- Module source code: flexigo_spain_verifactu 20.0 (aa2ea3d2): models/verifactu_cola_envio.py
- Module source code: flexigo_spain_verifactu 20.0 (aa2ea3d2): data/verifactu_crons.xml
- prewww2.aeat.es/static_files/common/internet/dep/aplicaciones/es/aeat/tikeV1.0/cont/ws/err
