Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions barcodes_generator_product/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
.. 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 (Templates and Variants)
=======================================================

This module expands Odoo functionality, allowing user to generate barcode
depending on a given barcode rule for Products.

For example, 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:

* Assign a pattern (barcode.rule) to a product.product

* 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

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

To configure this module, see the 'Configuration' Section of the description
of the module 'barcodes_generator_abstract'

Usage
=====

To use this module, you need to:

* Go to a Product form (or a template form):

1 for manual generation
* Set a Barcode Rule
* Set a Barcode Base
* click on the button 'Generate Barcode (Using Barcode Rule)'

.. image:: /barcodes_generator/static/description/product_template_manual_generation.png

2 for automatic generation
* Set a Barcode Rule
* click on the button 'Generate Base (Using Sequence)'
* click on the button 'Generate Barcode (Using Barcode Rule)'


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/150/10.0

Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/stock-logistics-barcode/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smash it by providing detailed and welcomed feedback.

Credits
=======

Images
------

* 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
* Product tag by `Zlatko Najdenovski <https://www.iconfinder.com/zlaten>`_ and is licensed
under `CC BY 3.0 <https://creativecommons.org/licenses/by/3.0/>`_.

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

* Sylvain LE GAL (https://twitter.com/legalsylvain)
* Dave Lasley <dave@laslabs.com>

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.

3 changes: 3 additions & 0 deletions barcodes_generator_product/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models
32 changes: 32 additions & 0 deletions barcodes_generator_product/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright (C) 2014-Today GRAP (http://www.grap.coop)
# Copyright (C) 2016-Today La Louve (http://www.lalouve.net)
# Copyright (C) 2018 Komit (https://komit-consulting.com)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
'name': 'Generate Barcodes for Products',
'summary': 'Generate Barcodes for Products (Templates and Variants)',
'version': '11.0.1.0.0',
'category': 'Tools',
'author':
'GRAP,'
'La Louve,'
'Odoo Community Association (OCA)',
'website': 'https://www.odoo-community.org',
'license': 'AGPL-3',
'depends': [
'barcodes_generator_abstract',
'product',
],
'data': [
'views/view_product_product.xml',
'views/view_product_template.xml',
],
'demo': [
'demo/res_users.xml',
'demo/barcode_rule.xml',
'demo/product.xml',
'demo/function.xml',
],
}
26 changes: 26 additions & 0 deletions barcodes_generator_product/demo/barcode_rule.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2016-Today: GRAP (http://www.grap.coop)
Copyright (C) 2016-Today La Louve (http://www.lalouve.net)
@author Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->

<odoo>

<!-- Note: type should be 'price' or 'weight' but this keys are define in point_of_sale module
Not a big deal, this is just demo data, used for tests.
-->
<record id="product_generated_barcode" model="barcode.rule">
<field name="name">Product Rule (Generated Barcode)</field>
<field name="barcode_nomenclature_id" ref="barcodes.default_barcode_nomenclature"/>

<field name="type">product</field>
<field name="sequence">999</field>
<field name="encoding">ean13</field>
<field name="pattern">20.....{NNNDD}</field>
<field name="generate_type" eval="'manual'" />
<field name="generate_model" eval="'product.product'" />
</record>

</odoo>
16 changes: 16 additions & 0 deletions barcodes_generator_product/demo/function.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2016-Today: GRAP (http://www.grap.coop)
Copyright (C) 2016-Today La Louve (http://www.lalouve.net)
@author Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>

<function model="product.template" name="generate_barcode" eval="[ref('product_template_mono_variant')]"/>

<function model="product.product" name="generate_barcode" eval="[ref('product_product_variant_1')]"/>

<function model="product.product" name="generate_barcode" eval="[ref('product_product_variant_2')]"/>

</odoo>
43 changes: 43 additions & 0 deletions barcodes_generator_product/demo/product.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2016-Today: GRAP (http://www.grap.coop)
Copyright (C) 2016-Today La Louve (http://www.lalouve.net)
@author Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->

<odoo>

<record id="product_template_mono_variant" model="product.template">
<field name="name">Template with Generated Barcode (Mono Variant)</field>
<field name="barcode_rule_id" ref="product_generated_barcode" />
<field name="barcode_base">50</field>
</record>

<record id="product_template_multi_variant" model="product.template">
<field name="name">Template with Generated Barcode (Multi Variant)</field>
<field name="barcode_rule_id" ref="product_generated_barcode" />
<field name="attribute_line_ids" eval="[(6,0,[ref('product.product_attribute_2')])]"/>
</record>

<record id="product_product_variant_1" model="product.product">
<field name="name">Product with Generated Barcode (Variant 1 - White)</field>
<field name="barcode_rule_id" ref="product_generated_barcode" />
<field name="barcode_base">10001</field>
<field name="product_tmpl_id" ref="product_template_multi_variant"/>
<field name="attribute_value_ids" eval="[(6,0,[ref('product.product_attribute_value_3')])]"/>
</record>

<record id="product_product_variant_2" model="product.product">
<field name="name">Product with Generated Barcode (Variant 2 - Black)</field>
<field name="barcode_rule_id" ref="product_generated_barcode" />
<field name="barcode_base">10002</field>
<field name="product_tmpl_id" ref="product_template_multi_variant"/>
<field name="attribute_value_ids" eval="[(6,0,[ref('product.product_attribute_value_4')])]"/>
</record>

<record id="product_template_multi_variant" model="product.template">
<field name="name">Template with Generated Barcode (Multi Variant)</field>
</record>

</odoo>
17 changes: 17 additions & 0 deletions barcodes_generator_product/demo/res_users.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2016-Today: GRAP (http://www.grap.coop)
Copyright (C) 2016-Today La Louve (http://www.lalouve.net)
@author Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->

<odoo>

<record id="base.user_root" model="res.users">
<field name="groups_id" eval="[
(4, ref('product.group_product_variant')),
]" />
</record>

</odoo>
120 changes: 120 additions & 0 deletions barcodes_generator_product/i18n/es_ES.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * barcodes_generator_product
#
# Translators:
# Fernando Lara <gennesis45@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-04-12 02:40+0000\n"
"PO-Revision-Date: 2017-04-12 02:40+0000\n"
"Last-Translator: Fernando Lara <gennesis45@gmail.com>, 2017\n"
"Language-Team: Spanish (Spain) (https://www.transifex.com/oca/teams/23907/es_ES/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: es_ES\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: barcodes_generator_product
#: model:ir.model.fields,help:barcodes_generator_product.field_product_template_generate_type
msgid ""
"Allow to generate barcode, including a number (a base) in the final barcode.\n"
" 'Base Set Manually' : User should set manually the value of the barcode base\n"
" 'Base managed by Sequence': User will use a button to generate a new base. This base will be generated by a sequence"
msgstr ""
"Permitir generar código de barras, incluyendo un número (una base) en el código de barras final.'U+23CE'\n"
"'Base Set Manually': El usuario debe establecer manualmente el valor del código de barras base'U+23CE'\n"
"'Base administrada por Secuencia': El usuario utilizará un botón para generar una nueva base. Esta base será generada por una secuencia"

#. module: barcodes_generator_product
#: model:ir.model.fields,field_description:barcodes_generator_product.field_product_template_barcode_base
msgid "Barcode Base"
msgstr "Base de código de barras"

#. module: barcodes_generator_product
#: model:ir.model.fields,field_description:barcodes_generator_product.field_product_template_barcode_rule_id
msgid "Barcode Rule"
msgstr "Regla del codigo de barras"

#. module: barcodes_generator_product
#: model:ir.model.fields,field_description:barcodes_generator_product.field_product_product_taxes_id
msgid "Customer Taxes"
msgstr ""

#. module: barcodes_generator_product
#: model:ir.model.fields,field_description:barcodes_generator_product.field_product_product_property_account_expense_id
msgid "Expense Account"
msgstr ""

#. module: barcodes_generator_product
#: model:ir.ui.view,arch_db:barcodes_generator_product.view_product_product_form
#: model:ir.ui.view,arch_db:barcodes_generator_product.view_product_template_form
msgid "Generate Barcode (Using Barcode Rule)"
msgstr ""

#. module: barcodes_generator_product
#: model:ir.ui.view,arch_db:barcodes_generator_product.view_product_product_form
#: model:ir.ui.view,arch_db:barcodes_generator_product.view_product_template_form
msgid "Generate Base (Using Sequence)"
msgstr ""

#. module: barcodes_generator_product
#: model:ir.model.fields,field_description:barcodes_generator_product.field_product_template_generate_type
msgid "Generate Type"
msgstr "Generar Tipo"

#. module: barcodes_generator_product
#: model:ir.model.fields,field_description:barcodes_generator_product.field_product_product_property_account_income_id
msgid "Income Account"
msgstr ""

#. module: barcodes_generator_product
#: model:ir.model,name:barcodes_generator_product.model_product_product
msgid "Product"
msgstr ""

#. module: barcodes_generator_product
#: model:ir.model,name:barcodes_generator_product.model_product_template
msgid "Product Template"
msgstr ""

#. module: barcodes_generator_product
#: model:product.template,name:barcodes_generator_product.product_template_mono_variant
msgid "Template with Generated Barcode (Mono Variant)"
msgstr ""

#. module: barcodes_generator_product
#: model:product.product,name:barcodes_generator_product.product_product_variant_1
#: model:product.product,name:barcodes_generator_product.product_product_variant_2
#: model:product.template,name:barcodes_generator_product.product_product_variant_1_product_template
#: model:product.template,name:barcodes_generator_product.product_product_variant_2_product_template
#: model:product.template,name:barcodes_generator_product.product_template_multi_variant
msgid "Template with Generated Barcode (Multi Variant)"
msgstr ""

#. module: barcodes_generator_product
#: model:ir.model.fields,help:barcodes_generator_product.field_product_product_property_account_expense_id
msgid ""
"This account will be used for invoices instead of the default one to value "
"expenses for the current product."
msgstr ""

#. module: barcodes_generator_product
#: model:ir.model.fields,help:barcodes_generator_product.field_product_product_property_account_income_id
msgid ""
"This account will be used for invoices instead of the default one to value "
"sales for the current product."
msgstr ""

#. module: barcodes_generator_product
#: model:ir.model.fields,field_description:barcodes_generator_product.field_product_product_supplier_taxes_id
msgid "Vendor Taxes"
msgstr ""

#. module: barcodes_generator_product
#: model:ir.model,name:barcodes_generator_product.model_barcode_rule
msgid "barcode.rule"
msgstr "regla.barra de codigos"
Loading