README.rst 4.41 KB
Newer Older
François C. committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
   :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
   :alt: License: AGPL-3

============================================
Generate Barcodes for Products and Customers
============================================

This module expends Odoo functionnality, allowing user to generate barcode
depending on a given barcode rule.

For exemple, a typical pattern for products is  "23.....{NNNDD}" that means
that:
* the EAN13 code will begin by '23'
* 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 product.product or a res.partner

* Generate the next Barcode base of a pattern. (to avoid duplicate barcode)

* Generate a barcode, based on a pattern and a barcode base

Installation
============

This module use an extra python librairy named 'pyBarcode' you should install
to make barcode generation works properly.

sudo pip install pyBarcode

Configuration
=============

To configure this module, you need to:

* Go to Point Of Sale / Configuration / Barcode Nomenclatures and select
* Select a Nomenclature
* Create or select a rule
.. image:: /barcodes_generate/static/description/barcode_rule_tree.png

* Check 'Available for Products', or 'Available for Partners' Checkbox.

.. image:: /barcodes_generate/static/description/barcode_rule_form.png

Usage
=====

To use this module, you need to:

* Go to a Product form (or a Partner Form):
* set a rule to the current object

.. image:: /barcodes_generate/static/description/product_product_form_generate_base_barcode.png

* Click on 'Generate Base and Barcode'

.. image:: /barcodes_generate/static/description/product_product_form_generated.png


Alternatively you can set manually a barcode base, and click only on Generate barcode.

.. image:: /barcodes_generate/static/description/product_product_form_generate_barcode.png


Try this module on Runbot

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
   :alt: Try me on Runbot
   :target: https://runbot.odoo-community.org/runbot/184/9.0

Inheritance
===========

If you want to generate barcode for another model, you can create a custom
module that inherits on 'barcodes_generate' 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. Dependency to point_of_sale is required because barcode field, defined in 'base'
module (in the res.partner model), is defined in a 'point_of_sale' view.
Furthermore, barcode nomenclature menu is available on Point Of Sale submenu.

It's a relative problem, because product barcodes generation will occures
mostly in a Point of Sale context.

You could comment 'point_of_sale' dependencies if you want to use this module
without point of sale installed.

2. 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
<https://github.com/OCA/pos/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
------

* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.

* Icon of the module is based on the Oxygen Team work and is under LGPL licence:
  http://www.iconarchive.com/show/oxygen-icons-by-oxygen-icons.org.html

Contributors
------------

* Sylvain LE GAL (https://twitter.com/legalsylvain)

Maintainer
----------

.. image:: https://odoo-community.org/logo.png
   :alt: Odoo Community Association
   :target: https://odoo-community.org

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.