The field and what the AEAT checks
The field is called FechaHoraHusoGenRegistro and stores the date, time and time zone of the moment the system generated the record, in the form YYYY-MM-DDThh:mm:ss plus the UTC offset. The AEAT validation document says it must be lower than or equal to the date on the AEAT system, allowing a margin of error. If it goes beyond that, the AEAT returns a warning without rejection.
The text of 2004 in the AEAT list is El valor del campo FechaHoraHusoGenRegistro debe ser la fecha actual del sistema de la AEAT, admitiéndose un margen de error de: and it stops right there: the list does not publish how many seconds or minutes that margin is.

The four codes for this field
| Code | AEAT text, in short | Effect |
|---|---|---|
| 2004 | Date and time must be the AEAT's current time, with a margin. | Accepted; the AEAT does not ask for a correction. |
| 1243 | Error técnico al obtener el cálculo de la fecha del huso horario. | Rejects the record because of an AEAT technical fault. |
| 1244 | El campo FechaHoraHusoGenRegistro tiene un formato incorrecto. | Rejects the record: wrong format. |
| 1268 | La longitud del campo FechaHoraHusoGenRegistro no cumple con las especificaciones. | Rejects the record: wrong length. |
In its list of admissible errors, the AEAT marks this case as one of the two that do not need a correction. The other one is an empty ClaveRegimen with the IPSI tax.
Where Odoo takes the time from
The module takes the moment it generated the invoicing record, when the invoice was posted, with its UTC offset. That moment is stored and cannot be changed afterwards, just like the hash, because it is part of what gets chained. The module always builds the format the same way, so a 1244 or a 1268 should not appear with a submission from our module: if you see one, send it to us.
For 2004, the question is whether the Odoo server clock was running fast when the invoice was posted. The module has a cron, Verifactu: Clock Drift Check, that every 1 hour compares Odoo's time with the time of its PostgreSQL database, and a button to do it whenever you want. It does not compare with any outside clock: if Odoo and the database run on the same machine, or both run fast, it gives no warning. The real time is checked against an NTP server.

What to do in each case
- With a 2004, nothing about the invoice: it is registered. Ask whoever manages the server to compare its time with an NTP server and synchronise it if it runs fast. Check Clock Drift does not help here: it only compares Odoo with its database.
- With a 1243, wait: it is a technical error on the AEAT side and the queue already retries on its own, with waits from 2 minutes to 12 hours, until the sixth attempt.
- With a 1244 or a 1268, write to comercial@flexigobe.com with the submission's answer.
In Odoo, a 2004 leaves the record as «Aceptado con errores (subsanar)», the same label as every 2xxx code. For this particular code the AEAT says no correction is needed: you can leave it as it is.
Does a clock that runs slow cause an error?
The AEAT rule only checks whether your time is greater than theirs plus the margin. A record whose time is behind does not trip this check.
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): models/verifactu_registro.py
- prewww2.aeat.es/static_files/common/internet/dep/aplicaciones/es/aeat/tikeV1.0/cont/ws/err
- Module source code: flexigo_spain_verifactu 20.0 (aa2ea3d2): models/verifactu_cadena.py
