OdooWiki OCA HUB

Product Sequence

product_sequence folder_open OCA/product-attribute open_in_new
Product License: AGPL-3

This module allows to associate a sequence to the product reference. The reference (default code) is unique (SQL constraint) and required.

You can optionally specify different sequences for different product categories.

auto_awesome What this module does

AI-generated from the code · Odoo 19.0

Automatically gives every new product an internal reference built from a numbered sequence, optionally using a different prefix per product category. Users can also type '/' in the internal reference to request a fresh number.

This module turns the product internal reference into an automatically numbered code instead of something typed by hand.

  • On each product category you can set a "Prefix for Product Internal Reference". When a product is created in that category, Odoo creates (or reuses) a numbering sequence for that prefix and assigns the next number, for example LAMP00001.
  • If a category has no prefix, the default product sequence (prefix PR/) is used. A company setting, "Use parent categories to determine the prefix", lets a category without its own prefix reuse the prefix of its parent category.
  • The setting appears in the general Product settings screen under a "Product Sequences" block.
  • The internal reference field now defaults to '/'. Saving a product with '/' asks Odoo to propose a new number; this also works when you change the category and want a new reference. If the product has only one variant, the same reference is written on its template.
  • Copying a product keeps an explicitly given reference instead of drawing a new number.
  • On installation, existing products with an empty or '/' reference are given a temporary placeholder so the required, unique reference rule is not broken.

The module touches product.product, product.template, product.category, ir.sequence, res.company and res.config.settings.

Depends on

product
Models and fields (6)
  • ir.sequence · extends an existing model
  • res.company · extends an existing modeluse_parent_categories_to_determine_prefix (Use parent categories to determine the prefix)
  • product.product · extends an existing modeldefault_code
  • product.category · extends an existing modelcode_prefix (Prefix for Product Internal Reference), sequence_id (Product Sequence)
  • product.template · extends an existing model
  • res.config.settings · extends an existing modeluse_parent_categories_to_determine_prefix

Text generated by AI (DeepSeek) from reading the Odoo 19.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: 8 confirmed, 1 with no information of 9 versions.

Sources · Odoo 17.0

Confirmed on 2026-11-03 in branch 17.0 of OCA/product-attribute.

terminal Installation and usage

OCA documentation · Odoo 19.0

To specify a different sequence for a product category proceed as follows:

  • Go to the a Product Category form view. (note: you will need to install Inventory app to be able to access to the form view, Inventory \> Configuration \> Products \> Products Categories; or create a menuitem manually).
  • Fill the Prefix for Product Internal Reference as desired.
  • Under the settings (Settings -\> General Settings -\> Product Sequences), you can specify whether the prefix of the parent category should be used if no prefix has been specified for the category.

Duplicating a product gives the copy its own new reference, drawn from the sequence of its category, just like any other new product. Odoo already appends (copy) to the name, which is what tells the two apart.

When the module is installed on a database with demo data, a few product categories (Lamps, Desk Lamps and Furniture) and products are created to illustrate the three cases: a category with its own prefix, a category inheriting the prefix of its parent, and a product without category falling back on the default product sequence.

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.