Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][MIG] barcodes_generator_product #444

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
30b30bb
New module barcode_generator_product
legalsylvain Nov 8, 2016
ab85b41
[MIG] barcodes_product_generator: Upgrade to v10
lasley Dec 28, 2016
fc9f9aa
OCA Transbot updated translations from Transifex
oca-transbot May 2, 2017
4cc0c8c
[MIG] barcodes_generator_product: Migration to 11.0
phatnguyenuit Jan 15, 2018
367faaa
11.0 [MIG] barcode_generator_lot
misern2 Nov 8, 2018
049d211
[MIG] barcodes_generator_product: Migration to 12.0
cvinh Aug 13, 2019
c6a2d49
Added translation using Weblate (Chinese (Simplified))
liweijie0812 Oct 18, 2019
289513d
Added translation using Weblate (Italian)
francesco-ooops Nov 25, 2020
c76a6f2
Translated using Weblate (Italian)
francesco-ooops Nov 25, 2020
754c5be
[IMP] barcodes_generator_product: black, isort, prettier
CarlosRoca13 Feb 3, 2021
58a4f6a
[MIG] barcodes_generator_product: Migration to v13.0
CarlosRoca13 Feb 8, 2021
c3ae834
[UPD] Update barcodes_generator_product.pot
oca-travis Apr 29, 2021
e334e5b
[UPD] README.rst
OCA-git-bot Apr 29, 2021
86cdc31
[IMP] barcodes_generator_product: black, isort, prettier
hugho-ad Aug 17, 2021
fc68d45
[MIG] barcodes_generator_product: Migration to 14.0
hugho-ad Aug 17, 2021
7592756
[UPD] Update barcodes_generator_product.pot
oca-travis Aug 18, 2021
57df4f8
[UPD] README.rst
OCA-git-bot Aug 18, 2021
ff1d64b
[FIX] fix UI, hide barcode field on template when having variants
sebastienbeau Jan 6, 2022
bdbc839
[FIX] add missing view on product easy form view
sebastienbeau Jan 7, 2022
40ad912
[UPD] Update barcodes_generator_product.pot
Apr 15, 2022
dd8ed80
[UPD] README.rst
OCA-git-bot Apr 15, 2022
2ca94a0
barcodes_generator_product 14.0.1.1.0
OCA-git-bot Apr 15, 2022
b6f1e28
Update translation files
oca-transbot Apr 15, 2022
9b95a58
Translated using Weblate (Italian)
SicurSam May 30, 2022
15c7238
[IMP] barcodes_generator_product: pre-commit stuff
tewtawat Oct 10, 2022
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
145 changes: 145 additions & 0 deletions barcodes_generator_product/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
==============================
Generate Barcodes for Products
==============================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--barcode-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-barcode/tree/14.0/barcodes_generator_product
:alt: OCA/stock-logistics-barcode
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-barcode-14-0/stock-logistics-barcode-14-0-barcodes_generator_product
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/150/14.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

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

**Table of contents**

.. contents::
:local:

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

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

To manage the barcode rule and the barcode base on products you need to include your
user on "Generate Barcodes" group.

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:: https://raw.githubusercontent.com/OCA/stock-logistics-barcode/14.0/barcodes_generator_product/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)'

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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/stock-logistics-barcode/issues/new?body=module:%20barcodes_generator_product%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
~~~~~~~

* GRAP
* La Louve

Contributors
~~~~~~~~~~~~

* Sylvain LE GAL (https://twitter.com/legalsylvain)
* Dave Lasley <[email protected]>
* `Tecnativa <https://www.tecnativa.com>`_:

* Carlos Roca

Other 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/>`_.

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

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

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.

.. |maintainer-legalsylvain| image:: https://github.com/legalsylvain.png?size=40px
:target: https://github.com/legalsylvain
:alt: legalsylvain

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-legalsylvain|

This module is part of the `OCA/stock-logistics-barcode <https://github.com/OCA/stock-logistics-barcode/tree/14.0/barcodes_generator_product>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
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
24 changes: 24 additions & 0 deletions barcodes_generator_product/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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": "15.0.1.0.0",
"category": "Tools",
"author": "GRAP, La Louve, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-barcode",
"license": "AGPL-3",
"depends": ["barcodes_generator_abstract", "product"],
"data": ["views/view_product_product.xml", "views/view_product_template.xml"],
"maintainers": ["legalsylvain"],
"demo": [
"demo/res_users.xml",
"demo/barcode_rule.xml",
"demo/product.xml",
"demo/function.xml",
],
}
25 changes: 25 additions & 0 deletions barcodes_generator_product/demo/barcode_rule.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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>
24 changes: 24 additions & 0 deletions barcodes_generator_product/demo/function.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?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>
85 changes: 85 additions & 0 deletions barcodes_generator_product/demo/product.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?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>
<!-- pylint:disable=duplicate-xml-record-id -->
<record id="product_template_multi_variant" model="product.template">
<field name="name">Template with Generated Barcode (Multi Variant)</field>
</record>
<!-- pylint:disable=duplicate-xml-record-id -->
<record
id="product_template_multi_variant_attribute_line"
model="product.template.attribute.line"
>
<field name="product_tmpl_id" ref="product_template_multi_variant" />
<field name="attribute_id" ref="product.product_attribute_2" />
<field
name="value_ids"
eval="[(6, 0, [ref('product.product_attribute_value_3'), ref('product.product_attribute_value_4')])]"
/>
</record>
<function model="ir.model.data" name="_update_xmlids">
<value
model="base"
eval="[{
'xml_id': 'barcodes_generator_product.product_variant_1',
'record': obj().env.ref('barcodes_generator_product.product_template_multi_variant_attribute_line').product_template_value_ids[0],
'noupdate': True,
}, {
'xml_id': 'barcodes_generator_product.product_variant_2',
'record': obj().env.ref('barcodes_generator_product.product_template_multi_variant_attribute_line').product_template_value_ids[1],
'noupdate': True,
},]"
/>
</function>
<function model="ir.model.data" name="_update_xmlids">
<value
model="base"
eval="[{
'xml_id': 'barcodes_generator_product.product_product_variant_1',
'record': obj().env.ref('barcodes_generator_product.product_template_multi_variant')._get_variant_for_combination(obj().env.ref('barcodes_generator_product.product_variant_1')),
'noupdate': True,
}, {
'xml_id': 'barcodes_generator_product.product_product_variant_2',
'record': obj().env.ref('barcodes_generator_product.product_template_multi_variant')._get_variant_for_combination(obj().env.ref('barcodes_generator_product.product_variant_2')),
'noupdate': True,
},]"
/>
</function>
<record id="product_product_variant_1" model="product.product">
<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" />
</record>
<record id="product_product_variant_2" model="product.product">
<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" />
</record>
<record
id="product_template_multi_variant_attribute_line"
model="product.template.attribute.line"
>
<field name="product_tmpl_id" ref="product_template_multi_variant" />
<field name="attribute_id" ref="product.product_attribute_2" />
<field
name="value_ids"
eval="[(6,0,[ref('product.product_attribute_value_3'), ref('product.product_attribute_value_4')])]"
/>
</record>
<record id="product_template_multi_variant" model="product.template">
<field
name="attribute_line_ids"
eval="[(6,0,[ref('product_template_multi_variant_attribute_line')])]"
/>
</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>
Loading