OdooWiki OCA HUB

Base Sequence Template

base_sequence_template folder_open OCA/server-tools open_in_new
Tools License: AGPL-3

This module provides a wizard to generate company-specific sequences from reusable sequence templates. It is designed for multi-company environments where each company requires its own ir.sequence records but shares a common configuration pattern. The wizard allows defining sequence templates that include dynamic placeholders referencing company fields.

During generation, placeholders of the form %(company_id.)s are automatically replaced with the corresponding values from each company. Other placeholders (for example %(year)s) are preserved and evaluated later by the standard sequence engine. The module also validates that all referenced company fields exist and checks that required company values are not empty.

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

Lets you define reusable sequence templates and generate one numbered sequence per company in a single step, automatically filling in company details such as name or registry number into the prefix and suffix.

This module adds a new "Sequence Templates" screen under the Sequences area of Odoo. A template stores the usual numbering settings: a name, a sequence code, standard or no-gap numbering, prefix, suffix, step and size. In the prefix and suffix you can use the normal date placeholders (year, month, day, etc.) and also company placeholders such as the company ID, company name or company registry number.

From the template list or form, a "Generate Sequences" button opens a small wizard. You pick the companies (only companies you are allowed to work on) and confirm; the module then creates one real sequence per selected company, named after the company and the template, and linked back to the template. Company placeholders are replaced with each company's own values, while date placeholders are left for Odoo's normal numbering engine.

Business rules and checks: - If a placeholder refers to a company field that does not exist, generation stops with an error. - If a selected company has an empty value for a field used in a template, generation is blocked until that field is filled in. - The wizard shows a warning that generating may duplicate or override existing sequences.

On the template form a counter button shows how many sequences were generated from it and opens that list. Only administrators can create, edit or delete templates and run the wizard; other internal users can only read templates.

Depends on

base_setup

Menus it adds

Sequence Templates
Models and fields (3)
  • ir.sequence · extends an existing modeltemplate_id
  • ir.sequence.template · new modelcode (Sequence Code), name, active, prefix, suffix, padding (Sequence Size), sequence_ids, implementation, sequence_count, number_increment (Step)
  • generate.company.sequences.wizard · new modelcompany_ids (Companies), template_ids (Sequence Templates)

Text generated by AI (DeepSeek) from reading the Odoo 18.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 18.0

Confirmed on 2026-11-03 in branch 18.0 of OCA/server-tools.

terminal Installation and usage

OCA documentation · Odoo 18.0

To use this module, follow these steps:

  • Create one or more sequence templates and define the desired prefix and suffix, with company placeholders if desired. You can use placeholders like:
  • %(company_id.id)s
  • %(company_id.name)s
  • %(company_id.vat)s
  • Select the templates you want to use.
  • Trigger the server action that opens the wizard to generate sequences for companies.
  • In the wizard, select the target companies.
  • Confirm to generate the sequences.

The wizard will:

  • Read the required company fields used in the templates.
  • Validate that those fields exist and are not empty.
  • Create one ir.sequence per selected company and template with the resolved values.

No verified information in OCA: Installation, 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.