Repository
OCA/stock-logistics-barcode · module folder · Try on Runboat
Module version
1.0.0
Category
Tools
Folder size
0.35 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/stock-logistics-barcode
Last tracking update
2026-08-07 09:06:27
Authors
Odoo Community Association (OCA), GRAP, LasLabs, La Louve
Maintainers
Odoo Community Association (OCA), GRAP, LasLabs, La Louve
Committers
Weblate, OCA-git-bot, oca-ci, Stéphane Mangin, Vicent-S73
Odoo dependencies
odoo/odoo:
- web
Python dependencies
python-barcode
System dependencies
None
Required by
barcodes_generator_product
Description
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

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
view_barcode_nomenclature_form barcode.nomenclature form Inherits barcodes.view_barcode_nomenclature_form
view_barcode_rule_form barcode.rule form Inherits barcodes.view_barcode_rule_form
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (2)

New fields (3)
  • barcode_base Integer
    copy=False help='This value is used to generate barcode according to the setting of the barcode rule.'
  • barcode_rule_id Many2one → barcode.rule
    comodel_name='barcode.rule' help='Select a rule to generate a barcode' string='Barcode Rule'
  • generate_type Selection
    related='barcode_rule_id.generate_type'
Public methods (4)
  • create(self, vals_list)
    @api.model_create_multi
    It creates a new barcode if automation is active.
  • generate_barcode(self)
  • generate_base(self)
  • write(self, vals)
    Generate new barcodes if a barcode rule with automation is applied.

New fields (5)
  • generate_automate Boolean
    help='Check this to automatically generate a base and a barcode if this rule is selected.' string='Automatic Generation'
  • generate_model Selection
    help="If 'Generate Type' is set, mention the model related to this rule." selection=[]
  • generate_type Selection
    default='no' help="Allow to generate barcode, including a number (a base) in the final barcode.\n\n - 'Base Set Manually' : User should set manually the value of the barcode base\n - 'Base managed by Sequence': System will generate the base via a sequence" required=True selection=_GENERATE_TYPE
  • padding Integer
    compute='_compute_padding' readonly=True store=True
  • sequence_id Many2one → ir.sequence
    comodel_name='ir.sequence' string='Generation Sequence'
Public methods (4)
  • create(self, vals_list)
    @api.model_create_multi
  • generate_sequence_if_required(self)
  • onchange_generate_type(self)
    @api.onchange('generate_type')
  • write(self, vals)

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…