Product Auto Internal Reference
Automatically assign a unique internal reference to every product variant the moment it is created โ zero manual effort.
What it does
Instant auto-assignment
References are generated at the moment a product variant is saved โ no extra clicks, no manual entry.
Configurable sequence
Pick your own prefix, padding length, and starting number. Ships with PROD-00001 out of the box.
Multi-company ready
Each company can have its own independent sequence, keeping references clean across business units.
Uniqueness enforced
A database-level constraint prevents duplicate references from ever being saved, even on import.
Copy-safe
Duplicating a product clears the old reference so a fresh one is automatically assigned to the copy.
Variant-level precision
Works at the product.product level โ each variant (size, colour, etc.) gets its own unique reference.
How to configure
Install the module
Go to Apps, search for Product Auto Internal Reference, and click Install.
Open Settings
Navigate to Settings โ Product Auto Reference. A default sequence (PROD- prefix, 5-digit padding) is already selected.
Choose or create a sequence
Select any existing ir.sequence or create a new one from Settings โ Technical โ Sequences. Set any prefix and padding you like.
Save and start creating products
Every new product variant will automatically receive a reference from your chosen sequence โ that's it!
Technical notes
The module extends product.product (variant model) at the create level.
It falls back gracefully: company sequence โ module default sequence โ sequence by code
product.auto.ref. A _sql_constraints entry enforces uniqueness on
default_code. No core Odoo files are modified.
Dependencies: product, stock, base_setup |
License: LGPL-3 |
Author: Odoo Nerd
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Inventory (stock)
• Discuss (mail) |
| Lines of code | 121 |
| Technical Name |
auto_reference_generate |
| License | LGPL-3 |
| Website | https://www.odoo.com |
Please log in to comment on this module