The AEAT rule, field by field
- TipoRectificativa
- Only with TipoFactura R1, R2, R3, R4 or R5, and mandatory in those cases. Missing on a corrective invoice gives 1114; present on a normal invoice gives 1115. A value outside the list gives 1107.
- FacturasRectificadas
- The block with the invoices being corrected. Only with R1 to R5, and not mandatory. On a normal invoice, 1117.
- ImporteRectificacion
- Only, and mandatory, when TipoRectificativa is S, correction by replacement. If it is missing, 1118; if it should not be there, 1119.
- FacturasSustituidas
- Only with TipoFactura F3, the exchange of simplified invoices. On any other type, 1116.
All seven codes reject the invoice record, not the whole submission.

How Odoo sends a credit note
Today the module does not tell correction reasons apart: every credit note goes out as R1, or as R5 if it corrects an invoice that was registered as simplified (F2). R2, R3 and R4 never go out, so a credit note that should be one of them under the rules is declared as R1. With that type:
- It always sends TipoRectificativa. No code in the module gives it a value other than I, correction by differences.
- If the credit note has an original invoice and that invoice has its VeriFactu record, it is included in FacturasRectificadas with your tax ID, its number and its date.
- It sends the amounts as negatives, as fits a correction by differences.
Working that way, most of these codes should not appear. 1114 and 1115 are covered because TipoRectificativa goes on every R and on no F. 1117 too, because FacturasRectificadas is only added to a credit note. And since the type is always I, the ImporteRectificacion block is never needed, so 1118 has no way to happen.

The exchange of simplified invoices
The F3 is the invoice that replaces one or more simplified invoices already issued. It is the only type that accepts FacturasSustituidas, and the module only fills it when the invoice is flagged as an exchange: with the F2 invoices it replaces, issued in Odoo or elsewhere, up to 1000. Before posting an exchange, the module checks that what is being replaced are simplified invoices already registered; if not, it will not let you post.
If you still get one
If you see any of these codes with a submission from the module, we want to know: most likely the credit note has something out of the ordinary. The rejected record is retried with the same data until Dead Letter and the published module does not send the correction on its own. Write to comercial@flexigobe.com with the credit note number and we will review it.
The codes on this page, with the AEAT's text
Each code with its literal text, in Spanish, as the AEAT's error list gives it:
| Code | AEAT text (Spanish) |
|---|---|
| 1107 | El valor del campo TipoRectificativa es incorrecto. |
| 1114 | Si la factura es de tipo rectificativa, el campo TipoRectificativa debe tener valor. |
| 1115 | Si la factura no es de tipo rectificativa, el campo TipoRectificativa no debe tener valor. |
| 1116 | Debe informarse el campo FacturasSustituidas sólo si la factura es de tipo F3. |
| 1117 | Si la factura no es de tipo rectificativa, el bloque FacturasRectificadas no podrá venir informado. |
| 1118 | Si la factura es de tipo rectificativa por sustitución el bloque ImporteRectificacion es obligatorio. |
| 1119 | Si la factura no es de tipo rectificativa por sustitución el bloque ImporteRectificacion no debe tener valor. |
Corrective invoices are not the same as cancellations. Cancelling an invoice in Odoo creates a cancellation record, with its own error codes: they are on the cancellations 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_cadena.py
- Module source code: flexigo_spain_verifactu 20.0 (aa2ea3d2): models/verifactu_cola_envio.py
- prewww2.aeat.es/static_files/common/internet/dep/aplicaciones/es/aeat/tikeV1.0/cont/ws/err
