OdooWiki OCA HUB

Product Category Code Unique

product_category_code_unique folder_open OCA/product-attribute open_in_new
Uncategorised License: AGPL-3

This module allows to restrict unique codes on product categories. If no code is provided, a code is generated by a sequence.

auto_awesome What this module does

AI-generated from the code · Odoo 17.0

Makes the code field on product categories unique and automatically fills it with a generated sequence number when left empty, so every category always has a distinct code.

This module adds a uniqueness rule to the code of product categories, so two categories can no longer share the same code. If you try to save a duplicate code, Odoo blocks the save with the message "The category code must be unique!".

It also removes the need to type a code by hand. When you create a new product category and leave the code empty (or set it to "/"), Odoo automatically assigns the next number from a dedicated sequence called "Product Category", formatted with the prefix "PC/" and four digits (for example PC/0001). The same automatic filling happens when you edit an existing category and clear its code.

During installation, existing categories that had no code or the default "/" are given a code built from their name and identifier, so the installation does not fail on demo or legacy data.

Everything happens on the product category screen (the product.category model) that you reach from the Products area. No new menus or reports are added; the change is a business rule applied when categories are created or updated.

Depends on

Models and fields (1)
  • product.category · extends an existing model

Text generated by AI (DeepSeek) from reading the Odoo 17.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: 4 confirmed, 5 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

No verified information

Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.

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.