OdooWiki OCA HUB

Secuencia para facturas separada de la secuencia de asientos

l10n_es_account_invoice_sequence folder_open OCA/l10n-spain open_in_new
Accounting License: AGPL-3

Este módulo separa los números de las facturas de los de los asientos. Para ello, convierte el campo number de 'related' a campo de texto normal, y le asigna un valor según una nueva secuencia definida en el diario correspondiente.

Cuando una factura se cancela, tanto el número de la factura como el del asiento se guardan para que si se vuelve a validar, se mantengan ambos.

Su uso es obligatorio para España, ya que el sistema que utiliza por defecto Odoo no cumple los siguientes requisitos legales en España:

  • Las facturas deben llevar una numeración única y continua.
  • Los asientos de un diario deben ser correlativos según las fechas.

Al separar la numeración de las facturas de los asientos, es posible renumerar los asientos al final del ejercicio (por ejemplo mediante el módulo account_renumber) sin afectar a las facturas.

auto_awesome What this module does

AI-generated from the code · Odoo 12.0

Separates Spanish invoice numbering from journal entry numbering, giving each sales/purchase journal its own invoice and refund sequences, as required by Spanish law.

This module changes how invoice numbers are assigned in Spanish companies. Instead of taking the number from the journal entry, each invoice gets its own number from a dedicated sequence configured on the journal.

On the journal form (Accounting > Configuration > Journals), for sales and purchase journals you now see two extra fields: 'Invoice sequence' and 'Refund sequence'. These let you choose which numbering series is used for normal invoices and which for refunds (credit notes).

When an invoice is validated, the module automatically assigns the next number from the appropriate sequence, based on the invoice date, and stores it both as the invoice number and as the invoice reference. The invoice reference is also added to the related journal entry, so it can be seen during bank reconciliation.

When a Spanish chart of accounts is installed, the module automatically creates a shared journal entry sequence and separate invoice and refund sequences for each sales and purchase journal. New journals created later reuse the same journal entry sequence, and changing a journal code does not silently change the sequence prefix.

It also checks that the company of the chosen sequence matches the company of the journal, and prevents deleting invoices that use a dedicated invoice sequence by clearing their move name first.

Depends on

l10n_esaccount
Models and fields (4)
  • ir.sequence · extends an existing model
  • account.invoice · extends an existing modelnumber, invoice_number
  • account.journal · extends an existing modelinvoice_sequence_id (Invoice sequence), refund_inv_sequence_id (Refund sequence)
  • account.chart.template · extends an existing model

Text generated by AI (DeepSeek) from reading the Odoo 12.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 1 confirmed, 8 with no information of 9 versions.

Sources · Odoo 12.0

Confirmed on 2026-11-03 in branch 12.0 of OCA/l10n-spain.

terminal Installation and usage

OCA documentation · Odoo 12.0

En el momento de la instalación, se auto-configuran las secuencias de facturas de todos los diarios de todas las compañías españolas existentes, poniendo la secuencia que había anteriormente en el campo "Secuencia de asiento", y creándose una nueva secuencia única por compañía para ese campo.

Cuando se valide una factura, la secuencia que se utilizará será la configurada en el campo "Secuencia de factura" en lugar de la "Secuencia de asiento".

En caso de crear una nueva compañía e instalar un plan contable español, la creación de los diarios se hará también con las secuencias correctamente definidas.

No verified information in OCA: Configuration.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.