Generate Barcodes (Abstract)
(0)
399
GRAP

Generate Barcodes (Abstract)

FREE
Technical name
barcodes_generator_abstract
License
AGPL-3
Secure dependencies
N/A
Generate Barcodes (Abstract)

Generate Barcodes (Abstract)

Beta License: AGPL-3 OCA/stock-logistics-barcode Translate me on Weblate Try me on Runboat

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

Table of contents

Installation

This module use an extra python library named ‘python-barcode’ you should install to make barcode generation works properly.

sudo pip install python-barcode

Configuration

To configure this module, you need to:

  • Go to Settings / Technical / Sequences & Identifiers / Barcode Nomenclatures
  • Select a Nomenclature
  • Create or select a rule
https://raw.githubusercontent.com/OCA/stock-logistics-barcode/14.0/barcodes_generator_abstract/static/description/barcode_rule_tree.png
  • For manual generation, set:
    • ‘Base set Manually’ in ‘Generate Type’
    • Set the model
https://raw.githubusercontent.com/OCA/stock-logistics-barcode/14.0/barcodes_generator_abstract/static/description/barcode_rule_form_manual.png
  • 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
https://raw.githubusercontent.com/OCA/stock-logistics-barcode/14.0/barcodes_generator_abstract/static/description/barcode_rule_form_sequence.png

In all cases, padding will be computed automaticaly, based on the number of ‘.’ in the Barcode Pattern field.

Usage

This 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.

Known issues / Roadmap

  • On barcode.rule model, constraint and domain system could be set between ‘type’ and ‘generate_model’ fields.
  • Cache is being cleared in a constraint in barcode.rule. Mutating in a constraint is bad practice & should be moved somewhere.

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • GRAP
  • La Louve
  • LasLabs

Images

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

This module is part of the OCA/stock-logistics-barcode project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

0.0 / 5.0
based on 0 ratings

Python dependencies

Package Version Secured
barcode_generator 0.1rc15
odoo_test_helper 2.1.1

Available languages

Language % translated
Italian / Italiano
100%
French / Français
85%
German / Deutsch
29%
Slovenian / slovenščina
14%
Spanish / Español
11%
Finnish / Suomi
11%
Dutch / Nederlands
7%
Portuguese (BR) / Português (BR)
7%
Dutch / Nederlands
7%
Galician / Galego
3%
Greek / Ελληνικά
3%
Croatian / hrvatski jezik
3%
Turkish / Türkçe
3%
Portuguese / Português
3%
Croatian / hrvatski jezik
3%
Portuguese / Português
3%
Chinese (Simplified) / 简体中文
0%