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

[MIG] barcodes_generator_abstract: Migration to 14.0 #313

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c496a6f
create new module 'barcodes_generator_abstract
legalsylvain Nov 8, 2016
88c66ef
[MIG] barcodes_generator_abstract: Upgrade to v10
lasley Dec 28, 2016
2de53dc
[10.0][IMP] barcodes_generator_abstract: Add automated generator (#77)
lasley Feb 18, 2017
c1fc706
[10.0][FIX] barcodes_generator_abstract: Caching issue (#103)
lasley Sep 4, 2017
1b5760d
OCA Transbot updated translations from Transifex
oca-transbot Nov 29, 2016
c944ab3
[FIX] do not copy barcode_base during duplication
legalsylvain Jun 8, 2018
20ad242
[MIG] barcodes_generator_abstract: Migration to 11.0
phatnguyenuit Jan 12, 2018
e253e2e
[FIX] barcodes_generator_abstract: Remove credits
pedrobaeza Jun 13, 2018
afd2b4b
[UPD] Update barcodes_generator_abstract.pot
oca-travis Jun 28, 2018
d60cb58
[UPD] Update barcodes_generator_abstract.pot
oca-travis Jul 8, 2018
b45fbf7
[UPD] Update barcodes_generator_abstract.pot
oca-travis Oct 2, 2018
3d0ed44
Update translation files
oca-transbot Dec 9, 2018
a96fd45
[UPD] Update barcodes_generator_abstract.pot
oca-travis May 5, 2019
cf0cbf5
Update translation files
oca-transbot May 20, 2019
3a37d45
[MIG] barcodes_generator_abstract: Migration to 12.0
cvinh Aug 13, 2019
c68125a
[FIX] add _description in BarcodeGenerateMixin
cvinh Aug 13, 2019
9704311
[IMP] Now we use python-barcode instead of viivakoodi (cf https://git…
cvinh Aug 13, 2019
b71ffaa
[FIX] change sequence_id Label (fix runbot)
cvinh Aug 14, 2019
dfc4f50
[UPD] Update barcodes_generator_abstract.pot
oca-travis Aug 16, 2019
dbe10e1
Update translation files
oca-transbot Aug 22, 2019
1d33c5e
[UPD] Update barcodes_generator_abstract.pot
oca-travis Sep 17, 2019
42e8944
Update translation files
oca-transbot Sep 18, 2019
df6d1ab
Added translation using Weblate (Chinese (Simplified))
liweijie0812 Oct 18, 2019
ee29a81
[UPD] Update barcodes_generator_abstract.pot
oca-travis Jan 30, 2020
39311d0
Update translation files
oca-transbot Jan 30, 2020
a686f7a
barcodes_generator_abstract 12.0.1.0.2
OCA-git-bot Mar 10, 2020
44c0f5c
Translated using Weblate (German)
AndreVolksdorf Aug 4, 2020
46cf9a1
Translated using Weblate (Slovenian)
sysadminmatmoz Aug 11, 2020
d6c6d04
[UPD] Update barcodes_generator_abstract.pot
oca-travis Sep 16, 2020
fa9f839
Update translation files
oca-transbot Sep 16, 2020
534a169
Update translation files
oca-transbot Nov 22, 2020
03e463d
Translated using Weblate (Italian)
francesco-ooops Nov 25, 2020
9883072
[IMP] barcodes_generator_abstract: black, isort, prettier
chafique-delli Dec 11, 2020
5009673
[MIG] barcodes_generator_abstract: Migration to 14.0
chafique-delli Dec 11, 2020
d7806ed
barcodes_generator_abstract: Fix warning
alexis-via Dec 15, 2020
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
152 changes: 152 additions & 0 deletions barcodes_generator_abstract/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
.. 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 any Models (Abstract)
===========================================

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

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:

* 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 '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

.. image:: /barcodes_generator_abstract/static/description/barcode_rule_tree.png

* For manual generation, set:
* 'Base set Manually' in 'Generate Type'
* Set the model

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

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

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

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
======================

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

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

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

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

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_abstract/__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
27 changes: 27 additions & 0 deletions barcodes_generator_abstract/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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 (Abstract)",
"summary": "Generate Barcodes for Any Models",
"version": "14.0.1.0.0",
"category": "Tools",
"author": "GRAP, La Louve, LasLabs, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-barcode",
"license": "AGPL-3",
"depends": [
"barcodes",
],
"data": [
"security/res_groups.xml",
"views/view_barcode_rule.xml",
"views/menu.xml",
],
"demo": [
"demo/res_users.xml",
],
"external_dependencies": {"python": ["barcode"]},
}
19 changes: 19 additions & 0 deletions barcodes_generator_abstract/demo/res_users.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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('barcodes_generator_abstract.generate_barcode')),
]"
/>
</record>

</odoo>
178 changes: 178 additions & 0 deletions barcodes_generator_abstract/i18n/am.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * barcodes_generator_abstract
#
# Translators:
# OCA Transbot <[email protected]>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-11-25 08:40+0000\n"
"PO-Revision-Date: 2016-11-25 08:40+0000\n"
"Last-Translator: OCA Transbot <[email protected]>, 2016\n"
"Language-Team: Amharic (https://www.transifex.com/oca/teams/23907/am/)\n"
"Language: am\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#. module: barcodes_generator_abstract
#: model:ir.model.fields,help:barcodes_generator_abstract.field_barcode_generate_mixin__generate_type
#: model:ir.model.fields,help:barcodes_generator_abstract.field_barcode_rule__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 ""

#. module: barcodes_generator_abstract
#: model:ir.model.fields,field_description:barcodes_generator_abstract.field_barcode_rule__generate_automate
msgid "Automatic Generation"
msgstr ""

#. module: barcodes_generator_abstract
#: model:ir.model.fields,field_description:barcodes_generator_abstract.field_barcode_generate_mixin__barcode_base
msgid "Barcode Base"
msgstr ""

#. module: barcodes_generator_abstract
#: model_terms:ir.ui.view,arch_db:barcodes_generator_abstract.view_barcode_rule_form
msgid "Barcode Generation"
msgstr ""

#. module: barcodes_generator_abstract
#: model:ir.ui.menu,name:barcodes_generator_abstract.menu_barcode_rule
msgid "Barcode Nomenclatures"
msgstr ""

#. module: barcodes_generator_abstract
#: model:ir.model,name:barcodes_generator_abstract.model_barcode_rule
#: model:ir.model.fields,field_description:barcodes_generator_abstract.field_barcode_generate_mixin__barcode_rule_id
msgid "Barcode Rule"
msgstr ""

#. module: barcodes_generator_abstract
#: selection:barcode.rule,generate_type:0
msgid "Base managed by Sequence"
msgstr ""

#. module: barcodes_generator_abstract
#: selection:barcode.rule,generate_type:0
msgid "Base set Manually"
msgstr ""

#. module: barcodes_generator_abstract
#: model:ir.model.fields,help:barcodes_generator_abstract.field_barcode_rule__generate_automate
msgid ""
"Check this to automatically generate a barcode upon creation of a new record "
"in the mixed model."
msgstr ""

#. module: barcodes_generator_abstract
#: model:ir.model.fields,field_description:barcodes_generator_abstract.field_barcode_generate_mixin__display_name
msgid "Display Name"
msgstr ""

#. module: barcodes_generator_abstract
#: model:ir.model,name:barcodes_generator_abstract.model_barcode_generate_mixin
msgid "Generate Barcode Mixin"
msgstr ""

#. module: barcodes_generator_abstract
#: model:res.groups,name:barcodes_generator_abstract.generate_barcode
msgid "Generate Barcodes"
msgstr ""

#. module: barcodes_generator_abstract
#: code:addons/barcodes_generator_abstract/models/barcode_generate_mixin.py:55
#, python-format
msgid ""
"Generate Base can be used only with barcode rule with 'Generate Type' set to "
"'Base managed by Sequence'"
msgstr ""

#. module: barcodes_generator_abstract
#: model:ir.model.fields,field_description:barcodes_generator_abstract.field_barcode_rule__generate_model
msgid "Generate Model"
msgstr ""

#. module: barcodes_generator_abstract
#: model_terms:ir.ui.view,arch_db:barcodes_generator_abstract.view_barcode_rule_form
msgid "Generate Sequence"
msgstr ""

#. module: barcodes_generator_abstract
#: code:addons/barcodes_generator_abstract/models/barcode_rule.py:104
#, python-format
msgid ""
"Generate Sequence is possible only if 'Generate Type' is set to 'Base "
"managed by Sequence'"
msgstr ""

#. module: barcodes_generator_abstract
#: model:ir.model.fields,field_description:barcodes_generator_abstract.field_barcode_generate_mixin__generate_type
#: model:ir.model.fields,field_description:barcodes_generator_abstract.field_barcode_rule__generate_type
msgid "Generate Type"
msgstr ""

#. module: barcodes_generator_abstract
#: model:ir.model.fields,field_description:barcodes_generator_abstract.field_barcode_generate_mixin__id
msgid "ID"
msgstr "ID"

#. module: barcodes_generator_abstract
#: model:ir.model.fields,help:barcodes_generator_abstract.field_barcode_rule__generate_model
msgid "If 'Generate Type' is set, mention the model related to this rule."
msgstr ""

#. module: barcodes_generator_abstract
#: model:ir.model.fields,field_description:barcodes_generator_abstract.field_barcode_generate_mixin____last_update
msgid "Last Modified on"
msgstr ""

#. module: barcodes_generator_abstract
#: selection:barcode.rule,generate_type:0
msgid "No generation"
msgstr ""

#. module: barcodes_generator_abstract
#: code:addons/barcodes_generator_abstract/models/barcode_rule.py:82
#, python-format
msgid "Only one rule per model can be used for automatic barcode generation."
msgstr ""

#. module: barcodes_generator_abstract
#: model:ir.model.fields,field_description:barcodes_generator_abstract.field_barcode_rule__padding
msgid "Padding"
msgstr ""

#. module: barcodes_generator_abstract
#: selection:barcode.rule,generate_model:0
msgid "Partners"
msgstr ""

#. module: barcodes_generator_abstract
#: selection:barcode.rule,generate_model:0
msgid "Products"
msgstr ""

#. module: barcodes_generator_abstract
#: code:addons/barcodes_generator_abstract/models/barcode_rule.py:114
#, python-format
msgid "Sequence - %s"
msgstr ""

#. module: barcodes_generator_abstract
#: model:ir.model.fields,field_description:barcodes_generator_abstract.field_barcode_rule__sequence_id
msgid "Sequence Id"
msgstr ""

#. module: barcodes_generator_abstract
#: selection:barcode.rule,generate_model:0
msgid "Stock Location"
msgstr ""
Loading