Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. Inventory
  3. Product Auto Reference v 18.0
  4. Sales Conditions FAQ

Product Auto Reference

by Mr X
Odoo

$ 15.07

v 18.0 Third Party
Apps purchases are linked to your Odoo account, please sign in or sign up first.
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies Discuss (mail)
Lines of code 543
Technical Name product_auto_reference
LicenseLGPL-3
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies Discuss (mail)
Lines of code 543
Technical Name product_auto_reference
LicenseLGPL-3

Product Auto Reference - Odoo 18

📋 Description

This module automatically generates internal product references based on the product category hierarchy.

Reference format: PARENT_CODE + CHILD_CODE + ... + SEQUENCE

Example: PUI002010001

  • PUI : Parent category code (Powers)
  • 002 : Level 1 child category code (Motors)
  • 010 : Level 2 child category code (Single-phase)
  • 0001 : Automatic sequential number

✨ Features

1. Category Management

  • Add a Code field on product categories
  • Automatic calculation of Prefix based on hierarchy
  • Display of Next Number in sequence
  • Automatic creation of an ir.sequence for each category
  • Automatic update of prefixes when hierarchy changes

2. Product Management

  • Automatic reference generation on creation
  • Auto Reference option that can be enabled/disabled per product
  • Button to Regenerate reference manually
  • Reference update when category changes

3. Administration Tools

  • Automatic initialization of sequences from existing database
  • Reset sequences
  • Manual definition of next number
  • Analysis wizard to identify existing references

🚀 Installation

  1. Copy the module to your Odoo addons directory
  2. Update the apps list: Apps → Update Apps List
  3. Search for "Product Auto Reference" and click Install

📖 User Guide

Initial Configuration

Step 1: Configure Category Codes

  1. Go to Inventory → Configuration → Product Categories
  2. For each category, fill in the Category Code field

Example structure:

Powers (PUI)
├── Electric Motors (002)
│   ├── Single-phase (010)
│   │   ├── 0.5-1.5 kW (001)
│   │   └── 2-5 kW (002)
│   └── Three-phase (011)
│       ├── 0.5-1.5 kW (001)
│       └── 2-5 kW (002)
└── Transformers (003)

The Reference Prefix field will be calculated automatically:

  • PUI → Prefix: PUI
  • Single-phase → Prefix: PUI002010
  • 0.5-1.5 kW (under Single-phase) → Prefix: PUI002010001

Step 2: Initialize Sequences (if you already have products)

Option A: From existing database

  1. Go to Inventory → Configuration → Initialize Sequences
  2. Select Mode: Automatic
  3. Click Initialize

The system will:

  • Analyze all your existing products
  • Identify references that match category prefixes
  • Set next number = maximum number found + 1

Option B: Reset to zero

⚠️ Warning: This resets all sequences to 1

Daily Usage

Create a product with automatic reference

  1. Go to Inventory → Products → Create
  2. Select a Product Category
  3. The Auto Ref field is checked by default
  4. Do not fill the Internal Reference field
  5. Save

→ The reference will be generated automatically!

Example:

  • Category: Powers > Electric Motors > Single-phase > 0.5-1.5 kW
  • Prefix: PUI002010001
  • Generated reference: PUI0020100010001

Create a product with manual reference

  1. Create the product
  2. Uncheck the Auto Ref field
  3. Fill in the Internal Reference manually

Regenerate a reference

On the product form:

  1. Click the Regenerate Reference button (at the top)
  2. A new reference will be generated

🔧 Advanced Management

Modify the next sequence number

  1. Go to a Product Category
  2. Click Set Next Number
  3. Enter the desired number
  4. Validate

Reset a sequence

  1. Go to a Product Category
  2. Click Reset Sequence
  3. Confirm

→ The next number will be 1

Change category hierarchy

If you move a category in the tree:

  • The Reference Prefix is automatically recalculated
  • The Sequence is updated
  • Child categories are also updated

⚠️ Note: Already created products keep their old reference. Use the Regenerate Reference button if necessary.


🎯 Usage Examples

Example 1: Electrical Equipment

Structure:

ELE (Electrical)
├── MOT (Motors)
│   ├── AC (Alternating Current)
│   │   ├── MONO (Single-phase)
│   │   └── TRI (Three-phase)
│   └── DC (Direct Current)
└── TRF (Transformers)

Generated references:

  • Three-phase motor: ELEMOTACTRI0001
  • Single-phase motor: ELEMOTACMONO0001
  • Transformer: ELETRF0001

Example 2: Hardware

Structure:

QUI (Hardware)
├── VIS (Screws)
│   ├── BTC (Wood cross-head)
│   │   ├── 30 (3.0mm)
│   │   └── 40 (4.0mm)
│   └── MTL (Metals)
└── CHE (Anchors)

Generated references:

  • Wood screw 3.0mm: QUIVISBTC300001
  • Wood screw 4.0mm: QUIVISBTC400001
  • Metal screw: QUIVISMTL0001

⚙️ Technical Configuration

Sequence Structure

The module uses ir.sequence with the following parameters:

  • Prefix: Automatically calculated from hierarchy
  • Padding: 4 digits (0001, 0002, ..., 9999)
  • Increment: +1
  • Implementation: Standard

Added Fields

On product.category:

  • category_code (Char): Category code
  • sequence_id (Many2one): Link to ir.sequence
  • next_number (Integer, computed): Next number
  • reference_prefix (Char, computed, stored): Calculated prefix

On product.template:

  • auto_reference (Boolean): Enable/disable auto generation

🔒 Access Rights

  • Users: Can create products with auto reference
  • Administrators: Full access + sequence initialization

🐛 Troubleshooting

Problem: Reference is not generated

Checks:

  1. Is the Auto Ref field checked?
  2. Does the category have a Code filled in?
  3. Do all parent categories have a code?

Problem: Duplicate reference

Solutions:

  1. Use the Initialize Sequences wizard in automatic mode
  2. Verify that each category has a unique sequence
  3. Manually set the next number

Problem: Prefix is not correct

Causes:

  1. A parent category doesn't have a code
  2. The hierarchy has been modified

Solution:

  1. Check all codes in the hierarchy
  2. The prefix should recalculate automatically

📝 Important Notes

  1. Code length: Codes can be any length, but be consistent
  2. Spaces: Codes must not contain spaces
  3. Uniqueness: Each category code must be unique in the entire database
  4. Padding: The sequence uses 4 digits by default (0001-9999)
  5. Persistence: Sequences are saved even after module uninstallation

📄 License

LGPL-3


👨‍💻 Author

Developed by Mr X

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author or have a question related to your purchase, please use the support page.
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with