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
    • Property 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. Top Auto Barcode Sequence v 19.0
  4. Sales Conditions FAQ

Top Auto Barcode Sequence

by TopBusiness https://www.topbusiness.io
Odoo
v 19.0 Third Party 3
Download for v 19.0 Deploy on Odoo.sh
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 322
Technical Name top_auto_barcode_seqance
LicenseLGPL-3
Websitehttps://www.topbusiness.io
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies Discuss (mail)
Lines of code 322
Technical Name top_auto_barcode_seqance
LicenseLGPL-3
Websitehttps://www.topbusiness.io
Top Auto Barcode Sequence — category to barcode flow
Top Auto Barcode Sequence module icon
Odoo 19 · Inventory

Top Auto Barcode Sequence for Odoo 19

Automatically generate product barcodes and internal references (default_code) by product category, using prefixes, custom patterns, and smart sequence detection within each category.

  • Category-based barcode generation
  • Automatic internal reference / default_code generation
  • Custom patterns with zero-padding
  • Never overwrites existing product codes
  • Works with product variants (standard template ↔ variant fields)
Need help? WhatsApp +20 101 182 7324 Email info@topbusiness.io

The problem

Managing product barcodes and internal references manually leads to duplicate codes, inconsistent formats, slower product creation, and weak alignment between codes and product categories. Teams need a predictable, category-driven way to assign the next barcode or internal reference without breaking existing data.

The solution

Top Auto Barcode Sequence extends each Product Category with optional barcode prefix, internal reference prefix, barcode pattern, and internal reference pattern. When a product is created or saved with an empty barcode or empty internal reference, the module fills it automatically if the category sequence is enabled. The next value is based on the highest matching code already used on products in the same category— not a global sequence.

What you get

Barcode prefix per category

Define how barcodes should start for each category.

Internal reference prefix per category

Same idea for default_code/ internal reference.

Custom barcode pattern

Format barcodes with placeholders — not a single fixed template.

Custom internal reference pattern

Independent pattern for internal references.

Zero-padded numeric sequences

Use {n:W} for fixed-width numbers (1–32 digits).

Smart next number detection

Next value = max matching code in the same category + 1.

Case-insensitive matching

Finding the “last number” ignores case on the full string.

Existing codes are protected

Non-empty barcodes and internal references are never overwritten.

Variant-compatible behavior

Uses standard product.template writes; barcode and default_code follow Odoo’s variant inverse.

Pattern placeholders

PlaceholderMeaning
{p}Category prefix for that line: either the barcode prefix or the internal reference prefix.
{n}Sequence number without padding (e.g. 1, 2, 12).
{n:W}Sequence number zero-padded to width W, where W is between 1 and 32. Example:{n:6}→000001.

Pattern rules

  • The pattern must contain exactly one {n} or {n:W}.
  • If {p} is used, the matching prefix field must be filled.
  • If the pattern is empty but the prefix is set, the default pattern is {p}-{n}.
  • Numeric-only sequences are supported (e.g. {n:8}) with an empty prefix and no {p} in the pattern.
  • Generated barcodes: prefix from {p} is normalized to uppercase.
  • Internal reference: prefix is kept as entered (still limited to letters, digits, and optional hyphen).

Examples

PrefixPatternExample outputs
ACEmpty (default {p}-{n})AC-1, AC-2
AC{p}{n}AC1, AC2
AC{p}_{n:4}AC_0001, AC_0002
Empty{n:8}00000001, 00000002

How to use it

  1. Open Product Categories and edit a category.
  2. Under Automatic barcode/ Automatic internal reference, set the prefix and optionally a custom pattern (see on-form help in Odoo).
  3. Create or save a product in that category with an empty barcode or empty internal reference. The module fills it when the category sequence is enabled.

Technical notes

  • Odoo version: 19.0
  • Manifest version: 19.0.1.1.0
  • Module folder: top_auto_barcode_seqance
  • Depends on: product
  • Form inherits: product.product_category_form_view
  • Existing non-empty barcodes or internal references are never overwritten.
  • Matching when resolving the last number is case-insensitive on the full string.
  • On product.template, barcode and default_code are stored on variants; writes on the template use the standard inverse (same as the Odoo UI).

This module does not add barcode printing, hardware scanning, POS hooks, accounting postings, or special multi-company logic beyond standard product behavior.

Ready to automate your product codes?

Save time, reduce mistakes, and keep barcodes and internal references consistent — per category, without touching existing codes.

WhatsApp +20 101 182 7324info@topbusiness.iowww.topbusiness.io

Top Business — Odoo implementation and apps ·topbusiness.io

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, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.
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