Generate Barcodes (Abstract)
This module extends Odoo functionality, allowing user to generate barcode depending on a given barcode rule for any Model.
For example, if the barcode pattern is "20.....{NNNDD}":
- the EAN13 code will begin with '20',
- followed by 5 digits (named Barcode Base in this module),
- followed by 5 others digits to define the variable price with 2 decimals,
- the last digit (the 13rd digit) is the control digit (i.e. the checksum).
With this module, it is possible to:
- Affect a pattern (barcode.rule) to a model
- 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).
- automatically by a sequence, if you want to let Odoo 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.0Lets you attach a barcode rule to any Odoo model so barcodes can be generated automatically or manually from a pattern, with the middle part (the base) either typed by the user or produced by a sequence.
This module adds barcode generation settings to the existing barcode rules in Odoo. On a barcode rule you now choose a generation type: no generation, base set manually, or base managed by a sequence. You also pick the model the rule applies to, and the padding (number of dots in the pattern) is calculated automatically from the pattern.
When the generation type is a sequence, Odoo creates a numbering sequence for the rule if none is set, using the rule name and the padding. If you tick Automatic Generation, then whenever a record using that rule is created or its barcode rule is changed, Odoo fills in the barcode base from the sequence and generates the barcode itself, but only if those values are still empty.
A reusable component (mixin) provides the Barcode Rule, Barcode Base and generation type fields, plus buttons/actions to generate the base and the barcode. Generating a base only works for rules whose type is a sequence; otherwise an error message is shown. The barcode is built from the rule pattern, replacing the dots with the padded base and the N and D placeholders with zeros, then the checksum is computed.
A new user group, Generate Barcodes, controls access. A menu entry is added under the barcode configuration area, and the barcode rule and nomenclature forms show the new fields.
Depends on
Required by other modules
Menus it adds
Models and fields (2)
- barcode.rule · extends an existing modelpadding, sequence_id (Generation Sequence), generate_type, generate_model, generate_automate (Automatic Generation)
- barcode.generate.mixin · new modelbarcode_base, 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-03Confirmation status: 8 confirmed, 1 with no information of 9 versions.
Sources · Odoo 18.0
Confirmed on 2026-11-03 in branch 18.0 of OCA/stock-logistics-barcode.
terminal Installation and usage
OCA documentation · Odoo 19.0Installation
Source · Odoo 19.0This module use an extra python library named 'python-barcode' you should install to make barcode generation works properly.
sudo pip install python-barcode
Configuration
Source · Odoo 19.0To configure this module, you need to:
- Go to Settings / Technical / Sequences & Identifiers / Barcode Nomenclatures
- Select a Nomenclature
- Create or select a rule
- For manual generation, set:
- 'Base set Manually' in 'Generate Type'
- Set the model
- For automatic generation, set:
- 'Base managed by Sequence' in 'Generate Type'
- Set the model
- Generate a new sequence by button, or affect a existing one
In all cases, padding will be computed automaticaly, based on the number of '.' in the Barcode Pattern field.
Usage
Source · Odoo 19.0This module is an abstract module. You can configure Barcode Rule, but to enable this feature, you need to install an extra module for a given model. This repository provide 'barcodes_generator_product' and 'barcodes_generator_partner' module to generate barcode for product or partner model.
Alternatively, you can develop a custom module for a custom model. See 'Inheritance' parts.
If you want to generate barcode for another model, you can create a custom module that depend on 'barcodes_generator_abstract' and inherit your model like that:
class MyModel(models.Model):
_name = 'my.model'
_inherit = ['my.model', 'barcode.generate.mixin']
class barcode_rule(models.Model):
_inherit = 'barcode.rule'
generate_model = fields.Selection(selection_add=[('my.model', 'My Model')])Eventually, you should inherit your model view adding buttons and fields.
Note
Your model should have a field 'barcode' defined.
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.
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.