Hi,
In VeriFactu, each invoice must include a hash that references the previous invoice, creating an unbroken chain. If your server goes down and you lose part of the sequence, you cannot simply re-create invoices with the same hash manually — the integrity of the chain is critical, and AEAT requires that all breaks are traceable.
What you can do:
Recover the last valid invoice hash: Check your database or any available backups/logs to retrieve the last successfully registered invoice hash.
Resume from the last valid hash: When Odoo generates the next invoice, it will point to this hash, continuing the chain.
Do not manually alter previous invoices: Spanish law forbids altering already issued VeriFactu invoices. If the chain is broken, you must document the incident.
Fallback procedure: If invoices are lost and cannot be recovered, you need to issue new invoices with a proper explanation note (AEAT allows documenting exceptional cases like crashes).
Prevention: Always set up automated daily database backups and, if possible, a redundant environment to avoid breaks in the invoice sequence.
In summary, you cannot “repair” the broken invoices but you can continue the chain from the last valid hash and document the interruption, which is compliant with AEAT requirements.
Hope it helps