OdooWiki OCA HUB

Generate Barcodes for Products

barcodes_generator_product folder_open OCA/stock-logistics-barcode open_in_new
Tools License: AGPL-3

This module expands Odoo functionality, allowing user to generate barcode depending on a given barcode rule for Products.

For example, a typical pattern for products is "20.....{NNNDD}" that means that:

  • the EAN13 code will begin by '20'
  • followed by 5 digits (named Barcode Base in this module)
  • and after 5 others digits to define the variable price
  • a 13 digit control

Another common pattern is "8012345....." which means that:

  • the EAN13 code will begin with '8012345'
  • followed by 5 digits (named Barcode Base in this module)
  • and finally the 13th digit is the control digit

Note that a dot is not necessary in the pattern as the control digit is added automatically.

With this module, it is possible to:

  • Assign a pattern (barcode.rule) to a product.product
  • Define a Barcode base:
  • manually, if the base of the barcode must be set by a user. (typically an internal code defined in your company)
  • automaticaly by a sequence, if you want to let Odoo to increment a sequence. (typical case of a customer number incrementation)
  • Generate a barcode, based on the defined pattern and the barcode base

auto_awesome What this module does

AI-generated from the code · Odoo 19.0

Lets users assign a barcode rule to a product and generate its barcode automatically, either from a sequence or manually, directly from the product form.

This module adds barcode generation to products. On a product form (both the product template and the product variant screens), a new "Barcode Rule" field appears next to the barcode, limited to rules defined for products. Once a rule is chosen, a "Barcode Base" field and a "Generate Barcode" button become available.

  • If the rule is set to generate by sequence, the base can be filled automatically with the "Generate Base" button and the barcode field becomes read-only; the barcode is then built from the rule pattern.
  • If the rule is set to manual, the user types the base themselves and clicks "Generate Barcode" to produce the final code.

For products with a single variant, the rule and base are shared between the template and its variant. For products with several variants, these fields are hidden on the template and must be set per variant. The module also adds "Products" as a possible target in the barcode rule configuration, so rules can be marked as usable for products. Access to these fields and buttons is limited to users belonging to the barcode generation group.

Models and fields (3)
  • barcode.rule · extends an existing modelgenerate_model
  • product.product · new model
  • product.template · extends an existing modelbarcode_base, generate_type (Generate Type), barcode_rule_id (Barcode Rule)

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 19.0

Confirmed on 2026-11-03 in branch 19.0 of OCA/stock-logistics-barcode.

terminal Installation and usage

OCA documentation · Odoo 19.0

To configure this module, see the 'Configuration' Section of the description of the module 'barcodes_generator_abstract'

To manage the barcode rule and the barcode base on products you need to include your user on "Generate Barcodes" group.

To use this module, you need to:

  • Go to a Product form (or a template form):

1 for manual generation

  • Set a Barcode Rule
  • Set a Barcode Base
  • click on the button 'Generate Barcode (Using Barcode Rule)'

2 for automatic generation

  • Set a Barcode Rule
  • click on the button 'Generate Base (Using Sequence)'
  • click on the button 'Generate Barcode (Using Barcode Rule)'

No verified information in OCA: Installation.

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.