diff --git a/.gitignore b/.gitignore index 6c200be..e03074a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,56 +1,133 @@ -# Archivos y carpetas generados por Odoo -*.log -*.pyc -*.pyo +# ---> Python +# Byte-compiled / optimized / DLL files __pycache__/ -*.db +*.py[cod] +*$py.class +*.py~ +*.xml~ +*~ +# C extensions +*.so -# Archivos de configuración de Odoo -*.sqlite -*.log -*.conf - -# Archivos de cache de Odoo -*.pid -*.sock -*.swp - -# Archivos de dependencias -*.egg -*.egg-info/ -dist/ +# Distribution / packaging +.Python build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST -# Entornos virtuales de Python -venv/ -env/ +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec -# Archivos de la base de datos -*.db -*.dump +# Installer logs +pip-log.txt +pip-delete-this-directory.txt -# Archivos de cobertura de prueba +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ .coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ -# Archivos de editor (emacs, vim, etc.) -*~ -*.swp -.vscode/ -.idea/ -.DS_Store +# Translations +*.mo +#*.pot -# Archivos de paquetes de dependencias -node_modules/ -*.bak - -# Archivos de logs +# Django stuff: *.log -*.out +local_settings.py +db.sqlite3 +db.sqlite3-journal -# Archivos de configuraciones locales de Odoo -*.ini +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ -# Archivos temporales de Odoo (y otros archivos temporales) -*.tmp -*.bak -*.swp diff --git a/barcode_generator_partner/README.rst b/barcode_generator_partner/README.rst new file mode 100644 index 0000000..0352349 --- /dev/null +++ b/barcode_generator_partner/README.rst @@ -0,0 +1,124 @@ +============================== +Generate Barcodes for Partners +============================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:0c984bdd1b103633bb285af4d69763047cc898ed9b6e3499c164a41d8e300f99 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/12.0/barcodes_generator_partner + :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-12-0/stock-logistics-barcode-12-0-barcodes_generator_partner + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-barcode&target_branch=12.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module expands Odoo functionality, allowing user to generate barcode +depending on a given barcode rule for Partners. + +For example, a typical pattern for partners is "042........." that means +that: + +* the EAN13 code will begin by '042' +* followed by 0 digits (named Barcode Base in this module) +* a 13 digit control + +With this module, it is possible to: + +* Assign a pattern (barcode.rule) to a res.partner + +* 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' + +Usage +===== + +To use this module, you need to: + +* Go to a Customer/Contact form, Sales & Purchases Tab: + +1 for manual generation + * Set a Barcode Rule + * Set a Barcode Base + * click on the button 'Generate Barcode (Using Barcode Rule)' + +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)' + +.. image:: https://raw.githubusercontent.com/barcodes_generator_partner/static/description/res_partner_sequence_generation.png + :width: 1100px + +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 to smash it by providing a detailed and welcomed +`feedback `_. + +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 +* Druidoo (https://druidoo.io) + +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. + +This module is part of the `OCA/stock-logistics-barcode `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/barcode_generator_partner/__init__.py b/barcode_generator_partner/__init__.py new file mode 100644 index 0000000..83e553a --- /dev/null +++ b/barcode_generator_partner/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import models diff --git a/barcode_generator_partner/__manifest__.py b/barcode_generator_partner/__manifest__.py new file mode 100644 index 0000000..609cd7a --- /dev/null +++ b/barcode_generator_partner/__manifest__.py @@ -0,0 +1,27 @@ +# Copyright (C) 2014-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). + +{ + "name": "Generate Barcodes for Partners", + "summary": "Generate Barcodes for Partners", + "version": "16.0.1.0.1", + "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", + "point_of_sale", + ], + "data": [ + "views/view_res_partner.xml", + ], + "demo": [ + "demo/ir_sequence.xml", + "demo/barcode_rule.xml", + "demo/res_partner.xml", + "demo/function.xml", + ], +} diff --git a/barcode_generator_partner/demo/barcode_rule.xml b/barcode_generator_partner/demo/barcode_rule.xml new file mode 100644 index 0000000..b3c7ee0 --- /dev/null +++ b/barcode_generator_partner/demo/barcode_rule.xml @@ -0,0 +1,25 @@ + + + + + + Partner Rule (Generated Barcode) + + client + 998 + ean13 + 042......... + + + + + + diff --git a/barcode_generator_partner/demo/function.xml b/barcode_generator_partner/demo/function.xml new file mode 100644 index 0000000..a2469da --- /dev/null +++ b/barcode_generator_partner/demo/function.xml @@ -0,0 +1,22 @@ + + + + + + + + + diff --git a/barcode_generator_partner/demo/ir_sequence.xml b/barcode_generator_partner/demo/ir_sequence.xml new file mode 100644 index 0000000..2aa10aa --- /dev/null +++ b/barcode_generator_partner/demo/ir_sequence.xml @@ -0,0 +1,16 @@ + + + + + + Partner Sequence (Generated Barcode) + 10 + 1 + + + diff --git a/barcode_generator_partner/demo/res_partner.xml b/barcode_generator_partner/demo/res_partner.xml new file mode 100644 index 0000000..147e9ff --- /dev/null +++ b/barcode_generator_partner/demo/res_partner.xml @@ -0,0 +1,15 @@ + + + + + + Partner with Generated Barcode + + + + diff --git a/barcode_generator_partner/i18n/barcodes_generator_partner.pot b/barcode_generator_partner/i18n/barcodes_generator_partner.pot new file mode 100644 index 0000000..2f1890a --- /dev/null +++ b/barcode_generator_partner/i18n/barcodes_generator_partner.pot @@ -0,0 +1,100 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * barcodes_generator_partner +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Alias" +msgstr "" + +#. module: barcodes_generator_partner +#: model:ir.model,name:barcodes_generator_partner.model_barcode_rule +msgid "Barcode Rule" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Client" +msgstr "" + +#. module: barcodes_generator_partner +#: model:ir.model,name:barcodes_generator_partner.model_res_partner +msgid "Contact" +msgstr "" + +#. module: barcodes_generator_partner +#: model_terms:ir.ui.view,arch_db:barcodes_generator_partner.view_res_partner_form +msgid "Generate Barcode (Using Barcode Rule)" +msgstr "" + +#. module: barcodes_generator_partner +#: model_terms:ir.ui.view,arch_db:barcodes_generator_partner.view_res_partner_form +msgid "Generate Base (Using Sequence)" +msgstr "" + +#. module: barcodes_generator_partner +#: model:ir.model.fields,field_description:barcodes_generator_partner.field_barcode_rule__generate_model +msgid "Generate Model" +msgstr "" + +#. module: barcodes_generator_partner +#: model:ir.model.fields,help:barcodes_generator_partner.field_barcode_rule__generate_model +msgid "If 'Generate Type' is set, mention the model related to this rule." +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Location" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Lot" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Package" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,generate_model:0 +msgid "Partners" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,generate_model:0 +msgid "Products" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,generate_model:0 +msgid "Stock Location" +msgstr "" + +#. module: barcodes_generator_partner +#: model:ir.model.fields,field_description:barcodes_generator_partner.field_barcode_rule__type +msgid "Type" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Unit Product" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Weighted Product" +msgstr "" + diff --git a/barcode_generator_partner/i18n/es.po b/barcode_generator_partner/i18n/es.po new file mode 100644 index 0000000..b061309 --- /dev/null +++ b/barcode_generator_partner/i18n/es.po @@ -0,0 +1,110 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * barcodes_generator_partner +# +# Translators: +# enjolras , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-15 02:01+0000\n" +"PO-Revision-Date: 2018-02-15 02:01+0000\n" +"Last-Translator: enjolras , 2018\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\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_partner +#: selection:barcode.rule,type:0 +msgid "Alias" +msgstr "" + +#. module: barcodes_generator_partner +#: model:ir.model,name:barcodes_generator_partner.model_barcode_rule +msgid "Barcode Rule" +msgstr "Regla de código de barras" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Client" +msgstr "" + +#. module: barcodes_generator_partner +#: model:ir.model,name:barcodes_generator_partner.model_res_partner +msgid "Contact" +msgstr "" + +#. module: barcodes_generator_partner +#: model_terms:ir.ui.view,arch_db:barcodes_generator_partner.view_res_partner_form +msgid "Generate Barcode (Using Barcode Rule)" +msgstr "" + +#. module: barcodes_generator_partner +#: model_terms:ir.ui.view,arch_db:barcodes_generator_partner.view_res_partner_form +msgid "Generate Base (Using Sequence)" +msgstr "" + +#. module: barcodes_generator_partner +#: model:ir.model.fields,field_description:barcodes_generator_partner.field_barcode_rule__generate_model +msgid "Generate Model" +msgstr "" + +#. module: barcodes_generator_partner +#: model:ir.model.fields,help:barcodes_generator_partner.field_barcode_rule__generate_model +msgid "If 'Generate Type' is set, mention the model related to this rule." +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Location" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Lot" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Package" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,generate_model:0 +msgid "Partners" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,generate_model:0 +msgid "Products" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,generate_model:0 +msgid "Stock Location" +msgstr "" + +#. module: barcodes_generator_partner +#: model:ir.model.fields,field_description:barcodes_generator_partner.field_barcode_rule__type +msgid "Type" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Unit Product" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Weighted Product" +msgstr "" + +#~ msgid "Barcode Base" +#~ msgstr "Base de código de barras" + +#~ msgid "barcode.rule" +#~ msgstr "barcode.rule" diff --git a/barcode_generator_partner/i18n/es_ES.po b/barcode_generator_partner/i18n/es_ES.po new file mode 100644 index 0000000..1be7bea --- /dev/null +++ b/barcode_generator_partner/i18n/es_ES.po @@ -0,0 +1,128 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * barcodes_generator_partner +# +# Translators: +# OCA Transbot , 2017 +# Fernando Lara , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-02 00:27+0000\n" +"PO-Revision-Date: 2017-05-02 00:27+0000\n" +"Last-Translator: Fernando Lara , 2017\n" +"Language-Team: Spanish (Spain) (https://www.transifex.com/oca/teams/23907/" +"es_ES/)\n" +"Language: es_ES\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_partner +#: selection:barcode.rule,type:0 +msgid "Alias" +msgstr "" + +#. module: barcodes_generator_partner +#: model:ir.model,name:barcodes_generator_partner.model_barcode_rule +msgid "Barcode Rule" +msgstr "Regla del codigo de barras" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Client" +msgstr "" + +#. module: barcodes_generator_partner +#: model:ir.model,name:barcodes_generator_partner.model_res_partner +msgid "Contact" +msgstr "" + +#. module: barcodes_generator_partner +#: model_terms:ir.ui.view,arch_db:barcodes_generator_partner.view_res_partner_form +msgid "Generate Barcode (Using Barcode Rule)" +msgstr "" + +#. module: barcodes_generator_partner +#: model_terms:ir.ui.view,arch_db:barcodes_generator_partner.view_res_partner_form +msgid "Generate Base (Using Sequence)" +msgstr "" + +#. module: barcodes_generator_partner +#: model:ir.model.fields,field_description:barcodes_generator_partner.field_barcode_rule__generate_model +#, fuzzy +msgid "Generate Model" +msgstr "Generar Tipo" + +#. module: barcodes_generator_partner +#: model:ir.model.fields,help:barcodes_generator_partner.field_barcode_rule__generate_model +msgid "If 'Generate Type' is set, mention the model related to this rule." +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Location" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Lot" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Package" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,generate_model:0 +msgid "Partners" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,generate_model:0 +msgid "Products" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,generate_model:0 +msgid "Stock Location" +msgstr "" + +#. module: barcodes_generator_partner +#: model:ir.model.fields,field_description:barcodes_generator_partner.field_barcode_rule__type +msgid "Type" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Unit Product" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Weighted Product" +msgstr "" + +#~ 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" + +#~ msgid "Barcode Base" +#~ msgstr "Base de código de barras" + +#~ msgid "barcode.rule" +#~ msgstr "regla.barra de codigos" diff --git a/barcode_generator_partner/i18n/fr.po b/barcode_generator_partner/i18n/fr.po new file mode 100644 index 0000000..246d6ca --- /dev/null +++ b/barcode_generator_partner/i18n/fr.po @@ -0,0 +1,127 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * barcodes_generator_partner +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-02 00:27+0000\n" +"PO-Revision-Date: 2017-05-02 00:27+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\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_partner +#: selection:barcode.rule,type:0 +msgid "Alias" +msgstr "" + +#. module: barcodes_generator_partner +#: model:ir.model,name:barcodes_generator_partner.model_barcode_rule +msgid "Barcode Rule" +msgstr "Règle de code barre" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Client" +msgstr "" + +#. module: barcodes_generator_partner +#: model:ir.model,name:barcodes_generator_partner.model_res_partner +msgid "Contact" +msgstr "" + +#. module: barcodes_generator_partner +#: model_terms:ir.ui.view,arch_db:barcodes_generator_partner.view_res_partner_form +msgid "Generate Barcode (Using Barcode Rule)" +msgstr "Générer un code barre (via règle de codes barre)" + +#. module: barcodes_generator_partner +#: model_terms:ir.ui.view,arch_db:barcodes_generator_partner.view_res_partner_form +msgid "Generate Base (Using Sequence)" +msgstr "Générer une base (via une séquence)" + +#. module: barcodes_generator_partner +#: model:ir.model.fields,field_description:barcodes_generator_partner.field_barcode_rule__generate_model +#, fuzzy +msgid "Generate Model" +msgstr "Type de génération" + +#. module: barcodes_generator_partner +#: model:ir.model.fields,help:barcodes_generator_partner.field_barcode_rule__generate_model +msgid "If 'Generate Type' is set, mention the model related to this rule." +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Location" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Lot" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Package" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,generate_model:0 +#, fuzzy +msgid "Partners" +msgstr "Partenaire" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,generate_model:0 +msgid "Products" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,generate_model:0 +msgid "Stock Location" +msgstr "" + +#. module: barcodes_generator_partner +#: model:ir.model.fields,field_description:barcodes_generator_partner.field_barcode_rule__type +msgid "Type" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Unit Product" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Weighted Product" +msgstr "" + +#~ 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 "" +#~ "Autorise à générer des codes barre en incluant un numéro (base du code " +#~ "barre) dans le code barre final.\n" +#~ " 'Base indiquée manuellement' : L'utilisateur devra indiquer manuellement " +#~ "la base du barcode\n" +#~ " 'Base gérée via une séquence': L'utilisateur devra utiliser un boutton " +#~ "pour générer une nouvelle base. Cette base sera générée par une séquence" + +#~ msgid "Barcode Base" +#~ msgstr "Base du code Barre" + +#~ msgid "barcode.rule" +#~ msgstr "barcode.rule" diff --git a/barcode_generator_partner/i18n/hr.po b/barcode_generator_partner/i18n/hr.po new file mode 100644 index 0000000..a3884f4 --- /dev/null +++ b/barcode_generator_partner/i18n/hr.po @@ -0,0 +1,128 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * barcodes_generator_partner +# +# Translators: +# Bole , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-15 02:01+0000\n" +"PO-Revision-Date: 2018-02-15 02:01+0000\n" +"Last-Translator: Bole , 2017\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Alias" +msgstr "" + +#. module: barcodes_generator_partner +#: model:ir.model,name:barcodes_generator_partner.model_barcode_rule +msgid "Barcode Rule" +msgstr "Barkod pravilo" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Client" +msgstr "" + +#. module: barcodes_generator_partner +#: model:ir.model,name:barcodes_generator_partner.model_res_partner +msgid "Contact" +msgstr "" + +#. module: barcodes_generator_partner +#: model_terms:ir.ui.view,arch_db:barcodes_generator_partner.view_res_partner_form +msgid "Generate Barcode (Using Barcode Rule)" +msgstr "Generiraj barkod (koristeći pravilo)" + +#. module: barcodes_generator_partner +#: model_terms:ir.ui.view,arch_db:barcodes_generator_partner.view_res_partner_form +msgid "Generate Base (Using Sequence)" +msgstr "Generiraj osnovno ( koristi br.krug)" + +#. module: barcodes_generator_partner +#: model:ir.model.fields,field_description:barcodes_generator_partner.field_barcode_rule__generate_model +#, fuzzy +msgid "Generate Model" +msgstr "Tip generatora" + +#. module: barcodes_generator_partner +#: model:ir.model.fields,help:barcodes_generator_partner.field_barcode_rule__generate_model +msgid "If 'Generate Type' is set, mention the model related to this rule." +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Location" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Lot" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Package" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,generate_model:0 +#, fuzzy +msgid "Partners" +msgstr "Partner" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,generate_model:0 +msgid "Products" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,generate_model:0 +msgid "Stock Location" +msgstr "" + +#. module: barcodes_generator_partner +#: model:ir.model.fields,field_description:barcodes_generator_partner.field_barcode_rule__type +msgid "Type" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Unit Product" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Weighted Product" +msgstr "" + +#~ 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 "" +#~ "Omogućuje generiranje barkodova, uključujući broj(osnova) u finalnom " +#~ "barkodu.\n" +#~ "'Osnova postavljena ručno' : korisnik treba ručno postaviti vrijednost " +#~ "osnovice barkoda.\n" +#~ "'Osnova prema sekvenci' : korisnik će koristiti guzmb za generirnje nove " +#~ "osnove. Ta osnova će biti generirana iz sekvence." + +#~ msgid "Barcode Base" +#~ msgstr "Osnova barkodova" + +#~ msgid "barcode.rule" +#~ msgstr "barcode.rule" diff --git a/barcode_generator_partner/i18n/nl_NL.po b/barcode_generator_partner/i18n/nl_NL.po new file mode 100644 index 0000000..5496f50 --- /dev/null +++ b/barcode_generator_partner/i18n/nl_NL.po @@ -0,0 +1,108 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * barcodes_generator_partner +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-07 15:18+0000\n" +"PO-Revision-Date: 2017-07-07 15:18+0000\n" +"Last-Translator: Peter Hageman , 2017\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\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_partner +#: selection:barcode.rule,type:0 +msgid "Alias" +msgstr "" + +#. module: barcodes_generator_partner +#: model:ir.model,name:barcodes_generator_partner.model_barcode_rule +msgid "Barcode Rule" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Client" +msgstr "" + +#. module: barcodes_generator_partner +#: model:ir.model,name:barcodes_generator_partner.model_res_partner +msgid "Contact" +msgstr "" + +#. module: barcodes_generator_partner +#: model_terms:ir.ui.view,arch_db:barcodes_generator_partner.view_res_partner_form +msgid "Generate Barcode (Using Barcode Rule)" +msgstr "" + +#. module: barcodes_generator_partner +#: model_terms:ir.ui.view,arch_db:barcodes_generator_partner.view_res_partner_form +msgid "Generate Base (Using Sequence)" +msgstr "" + +#. module: barcodes_generator_partner +#: model:ir.model.fields,field_description:barcodes_generator_partner.field_barcode_rule__generate_model +msgid "Generate Model" +msgstr "" + +#. module: barcodes_generator_partner +#: model:ir.model.fields,help:barcodes_generator_partner.field_barcode_rule__generate_model +msgid "If 'Generate Type' is set, mention the model related to this rule." +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Location" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Lot" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Package" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,generate_model:0 +msgid "Partners" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,generate_model:0 +msgid "Products" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,generate_model:0 +msgid "Stock Location" +msgstr "" + +#. module: barcodes_generator_partner +#: model:ir.model.fields,field_description:barcodes_generator_partner.field_barcode_rule__type +msgid "Type" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Unit Product" +msgstr "" + +#. module: barcodes_generator_partner +#: selection:barcode.rule,type:0 +msgid "Weighted Product" +msgstr "" + +#~ msgid "barcode.rule" +#~ msgstr "barcode.rule" diff --git a/barcode_generator_partner/models/__init__.py b/barcode_generator_partner/models/__init__.py new file mode 100644 index 0000000..d04ceba --- /dev/null +++ b/barcode_generator_partner/models/__init__.py @@ -0,0 +1,4 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import barcode_rule +from . import res_partner diff --git a/barcode_generator_partner/models/barcode_rule.py b/barcode_generator_partner/models/barcode_rule.py new file mode 100644 index 0000000..5442fb5 --- /dev/null +++ b/barcode_generator_partner/models/barcode_rule.py @@ -0,0 +1,12 @@ +# Copyright (C) 2014-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). + +from odoo import fields, models + + +class BarcodeRule(models.Model): + _inherit = "barcode.rule" + + generate_model = fields.Selection(selection_add=[("res.partner", "Partners")]) diff --git a/barcode_generator_partner/models/res_partner.py b/barcode_generator_partner/models/res_partner.py new file mode 100644 index 0000000..63490f2 --- /dev/null +++ b/barcode_generator_partner/models/res_partner.py @@ -0,0 +1,11 @@ +# Copyright (C) 2014-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). + +from odoo import models + + +class ResPartner(models.Model): + _name = "res.partner" + _inherit = ["res.partner", "barcode.generate.mixin"] diff --git a/barcode_generator_partner/readme/CONFIGURE.rst b/barcode_generator_partner/readme/CONFIGURE.rst new file mode 100644 index 0000000..f49c227 --- /dev/null +++ b/barcode_generator_partner/readme/CONFIGURE.rst @@ -0,0 +1 @@ +* To configure this module, see the 'Configuration' Section of the description of the module 'barcodes_generator_abstract' diff --git a/barcode_generator_partner/readme/CONTRIBUTORS.rst b/barcode_generator_partner/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..26d1341 --- /dev/null +++ b/barcode_generator_partner/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* Sylvain LE GAL (https://twitter.com/legalsylvain) +* Dave Lasley +* Druidoo (https://druidoo.io) +* Armand POLMARD (https://github.com/ArPol-developpement) diff --git a/barcode_generator_partner/readme/DESCRIPTION.rst b/barcode_generator_partner/readme/DESCRIPTION.rst new file mode 100644 index 0000000..12c9c26 --- /dev/null +++ b/barcode_generator_partner/readme/DESCRIPTION.rst @@ -0,0 +1,21 @@ +This module expands Odoo functionality, allowing user to generate barcode +depending on a given barcode rule for Partners. + +For example, a typical pattern for partners is "042........." that means +that: + +* the EAN13 code will begin by '042' +* followed by 0 digits (named Barcode Base in this module) +* a 13 digit control + +With this module, it is possible to: + +* Assign a pattern (barcode.rule) to a res.partner + +* 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 diff --git a/barcode_generator_partner/readme/USAGE.rst b/barcode_generator_partner/readme/USAGE.rst new file mode 100644 index 0000000..952c993 --- /dev/null +++ b/barcode_generator_partner/readme/USAGE.rst @@ -0,0 +1,16 @@ +To use this module, you need to: + +* Go to a Customer/Contact form, Sales & Purchases Tab: + +1 for manual generation + * Set a Barcode Rule + * Set a Barcode Base + * click on the button 'Generate Barcode (Using Barcode Rule)' + +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)' + +.. image:: /barcodes_generator_partner/static/description/res_partner_sequence_generation.png + :width: 1100px diff --git a/barcode_generator_partner/static/description/icon.png b/barcode_generator_partner/static/description/icon.png new file mode 100644 index 0000000..00f4e89 Binary files /dev/null and b/barcode_generator_partner/static/description/icon.png differ diff --git a/barcode_generator_partner/static/description/index.html b/barcode_generator_partner/static/description/index.html new file mode 100644 index 0000000..3b08781 --- /dev/null +++ b/barcode_generator_partner/static/description/index.html @@ -0,0 +1,480 @@ + + + + + + +Generate Barcodes for Partners + + + +
+

Generate Barcodes for Partners

+ + +

Beta License: AGPL-3 OCA/stock-logistics-barcode Translate me on Weblate Try me on Runboat

+

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

+

For example, a typical pattern for partners is “042………” that means +that:

+
    +
  • the EAN13 code will begin by ‘042’
  • +
  • followed by 0 digits (named Barcode Base in this module)
  • +
  • a 13 digit control
  • +
+

With this module, it is possible to:

+
    +
  • Assign a pattern (barcode.rule) to a res.partner
  • +
  • +
    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

+ +
+

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 Customer/Contact form, Sales & Purchases Tab:
  • +
+
+
1 for manual generation
+
    +
  • Set a Barcode Rule
  • +
  • Set a Barcode Base
  • +
  • click on the button ‘Generate Barcode (Using Barcode Rule)’
  • +
+
+
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)’
  • +
+
+
+https://raw.githubusercontent.com/barcodes_generator_partner/static/description/res_partner_sequence_generation.png +
+
+

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

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • GRAP
  • +
  • La Louve
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

This module is part of the OCA/stock-logistics-barcode project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/barcode_generator_partner/static/description/res_partner_sequence_generation.png b/barcode_generator_partner/static/description/res_partner_sequence_generation.png new file mode 100644 index 0000000..4b16e35 Binary files /dev/null and b/barcode_generator_partner/static/description/res_partner_sequence_generation.png differ diff --git a/barcode_generator_partner/tests/__init__.py b/barcode_generator_partner/tests/__init__.py new file mode 100644 index 0000000..22d1a55 --- /dev/null +++ b/barcode_generator_partner/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import test_barcodes_generator_partner diff --git a/barcode_generator_partner/tests/test_barcodes_generator_partner.py b/barcode_generator_partner/tests/test_barcodes_generator_partner.py new file mode 100644 index 0000000..2c72523 --- /dev/null +++ b/barcode_generator_partner/tests/test_barcodes_generator_partner.py @@ -0,0 +1,33 @@ +# 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). + +from odoo.tests.common import TransactionCase + + +class Tests(TransactionCase): + """Tests for 'Barcodes Generate""" + + def setUp(self): + super().setUp() + self.partner_obj = self.env["res.partner"] + + # Test Section + def test_01_sequence_generation_partner(self): + self.partner = self.partner_obj.browse( + self.ref("barcodes_generator_partner.res_partner_barcode") + ) + self.partner.generate_barcode() + self.assertEqual( + self.partner.barcode_base, + 1, + "Incorrect base Generation (by sequence) for Partner.", + ) + self.assertEqual( + self.partner.barcode, + "0420000000013", + "Barcode Generation (by sequence) for Partner." + "Incorrect EAN13 Generated. Pattern : %s - Base : %s" + % (self.partner.barcode_rule_id.pattern, self.partner.barcode_base), + ) diff --git a/barcode_generator_partner/views/view_res_partner.xml b/barcode_generator_partner/views/view_res_partner.xml new file mode 100644 index 0000000..4050f09 --- /dev/null +++ b/barcode_generator_partner/views/view_res_partner.xml @@ -0,0 +1,63 @@ + + + + + + res.partner + + + + + + +