Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

License: AGPL-3

Generate Barcodes for any Models (Abstract)

This module expends Odoo functionality, allowing user to generate barcode depending on a given barcode rule for any Model.

For exemple, 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

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)

    • 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

Installation

This module use an extra python library named ‘viivakoodi’ you should install to make barcode generation works properly. ‘viivakoodi’ is a more active for of ‘pyBarcode’.

sudo pip install viivakoodi

Configuration

To configure this module, you need to:

  • Go to Settings / Technical / Sequences & Identifiers / Barcode Nomenclatures

  • Select a Nomenclature

  • Create or select a rule

/barcodes_generator_abstract/static/description/barcode_rule_tree.png
  • For manual generation, set:
    • ‘Base set Manually’ in ‘Generate Type’

    • Set the model

/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

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

Try this module on Runbot

Try me on Runbot

Inheritance

If you want to generate barcode for another model, you can create a custom module that inherits 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’)])

Finally, you should inherit your model view adding buttons and fields.

Note

Your model should have a field ‘barcode’ defined.

Known issues / Roadmap

1. On barcode.rule model, constraint and domain system could be set between ‘type’ and ‘generate_model’ fields.

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 smashing it by providing a detailed and welcomed feedback.

Credits

Images

Contributors

Maintainer

Odoo Community Association

This module is maintained by the OCA.

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.

To contribute to this module, please visit https://odoo-community.org.

Metadata

Release files for odoo9-addon-barcodes-generator-abstract 9.0.1.0.0.99.dev8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for odoo9-addon-barcodes-generator-abstract 9.0.1.0.0.99.dev8
File Interpreter ABI Platform Actions
odoo9_addon_barcodes_generator_abstract-9.0.1.0.0.99.dev8-py2-none-any.whl Python 2 none any Details for odoo9_addon_barcodes_generator_abstract-9.0.1.0.0.99.dev8-py2-none-any.whl

Release files / odoo9_addon_barcodes_generator_abstract-9.0.1.0.0.99.dev8-py2-none-any.whl

Download URL odoo9_addon_barcodes_generator_abstract-9.0.1.0.0.99.dev8-py2-none-any.whl
Size 119.7 kB
Tags Python 2
SHA-256 checksum
How to use checksums
ec7dc20ec962744373b17ea750e266d82631a90ed399e8d1e5cd9470676a194a
BLAKE2b-256 checksum
How to use checksums
1c0471b4b45d65642c8e3b07f2dbbd26c9a2dc77e07b38e6933bb1967c5d3e92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.5

Security for odoo9-addon-barcodes-generator-abstract 9.0.1.0.0.99.dev8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page