odoo-addon-barcodes-generator-location 16.0.1.0.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- odoo/addons/barcodes_generator_location/README.rst +130 -0
- odoo/addons/barcodes_generator_location/__init__.py +2 -0
- odoo/addons/barcodes_generator_location/__manifest__.py +19 -0
- odoo/addons/barcodes_generator_location/demo/barcode_rule.xml +21 -0
- odoo/addons/barcodes_generator_location/demo/function.xml +17 -0
- odoo/addons/barcodes_generator_location/demo/ir_sequence.xml +12 -0
- odoo/addons/barcodes_generator_location/demo/stock_location.xml +12 -0
- odoo/addons/barcodes_generator_location/hooks.py +13 -0
- odoo/addons/barcodes_generator_location/i18n/barcodes_generator_location.pot +82 -0
- odoo/addons/barcodes_generator_location/i18n/es.po +95 -0
- odoo/addons/barcodes_generator_location/i18n/fr.po +95 -0
- odoo/addons/barcodes_generator_location/i18n/hr.po +96 -0
- odoo/addons/barcodes_generator_location/i18n/nl_NL.po +96 -0
- odoo/addons/barcodes_generator_location/models/__init__.py +3 -0
- odoo/addons/barcodes_generator_location/models/barcode_rule.py +11 -0
- odoo/addons/barcodes_generator_location/models/stock_location.py +48 -0
- odoo/addons/barcodes_generator_location/readme/CONFIGURE.rst +2 -0
- odoo/addons/barcodes_generator_location/readme/CONTRIBUTORS.rst +5 -0
- odoo/addons/barcodes_generator_location/readme/CREDITS.rst +2 -0
- odoo/addons/barcodes_generator_location/readme/DESCRIPTION.rst +20 -0
- odoo/addons/barcodes_generator_location/readme/USAGE.rst +15 -0
- odoo/addons/barcodes_generator_location/static/description/icon.png +0 -0
- odoo/addons/barcodes_generator_location/static/description/index.html +487 -0
- odoo/addons/barcodes_generator_location/static/description/stock_location_sequence_generation.png +0 -0
- odoo/addons/barcodes_generator_location/tests/__init__.py +2 -0
- odoo/addons/barcodes_generator_location/tests/test_barcode_generator.py +27 -0
- odoo/addons/barcodes_generator_location/views/stock_location.xml +56 -0
- odoo_addon_barcodes_generator_location-16.0.1.0.0.1.dist-info/METADATA +149 -0
- odoo_addon_barcodes_generator_location-16.0.1.0.0.1.dist-info/RECORD +31 -0
- odoo_addon_barcodes_generator_location-16.0.1.0.0.1.dist-info/WHEEL +5 -0
- odoo_addon_barcodes_generator_location-16.0.1.0.0.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,96 @@
|
|
1
|
+
# Translation of Odoo Server.
|
2
|
+
# This file contains the translation of the following modules:
|
3
|
+
# * barcodes_generator_location
|
4
|
+
#
|
5
|
+
# Translators:
|
6
|
+
# Peter Hageman <hageman.p@gmail.com>, 2017
|
7
|
+
msgid ""
|
8
|
+
msgstr ""
|
9
|
+
"Project-Id-Version: Odoo Server 10.0\n"
|
10
|
+
"Report-Msgid-Bugs-To: \n"
|
11
|
+
"POT-Creation-Date: 2017-07-07 15:18+0000\n"
|
12
|
+
"PO-Revision-Date: 2017-07-07 15:18+0000\n"
|
13
|
+
"Last-Translator: Peter Hageman <hageman.p@gmail.com>, 2017\n"
|
14
|
+
"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/"
|
15
|
+
"teams/23907/nl_NL/)\n"
|
16
|
+
"Language: nl_NL\n"
|
17
|
+
"MIME-Version: 1.0\n"
|
18
|
+
"Content-Type: text/plain; charset=UTF-8\n"
|
19
|
+
"Content-Transfer-Encoding: \n"
|
20
|
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
21
|
+
|
22
|
+
#. module: barcodes_generator_location
|
23
|
+
#: model:ir.model.fields,help:barcodes_generator_location.field_stock_location__generate_type
|
24
|
+
msgid ""
|
25
|
+
"Allow to generate barcode, including a number (a base) in the final "
|
26
|
+
"barcode.\n"
|
27
|
+
" 'Base Set Manually' : User should set manually the value of the barcode "
|
28
|
+
"base\n"
|
29
|
+
" 'Base managed by Sequence': User will use a button to generate a new base. "
|
30
|
+
"This base will be generated by a sequence"
|
31
|
+
msgstr ""
|
32
|
+
|
33
|
+
#. module: barcodes_generator_location
|
34
|
+
#: model_terms:ir.ui.view,arch_db:barcodes_generator_location.view_location_form
|
35
|
+
msgid "Barcode"
|
36
|
+
msgstr ""
|
37
|
+
|
38
|
+
#. module: barcodes_generator_location
|
39
|
+
#: model:ir.model.fields,field_description:barcodes_generator_location.field_stock_location__barcode_base
|
40
|
+
msgid "Barcode Base"
|
41
|
+
msgstr ""
|
42
|
+
|
43
|
+
#. module: barcodes_generator_location
|
44
|
+
#: model:ir.model,name:barcodes_generator_location.model_barcode_rule
|
45
|
+
#: model:ir.model.fields,field_description:barcodes_generator_location.field_stock_location__barcode_rule_id
|
46
|
+
msgid "Barcode Rule"
|
47
|
+
msgstr ""
|
48
|
+
|
49
|
+
#. module: barcodes_generator_location
|
50
|
+
#: model:ir.model.fields,field_description:barcodes_generator_location.field_barcode_rule__display_name
|
51
|
+
#: model:ir.model.fields,field_description:barcodes_generator_location.field_stock_location__display_name
|
52
|
+
msgid "Display Name"
|
53
|
+
msgstr ""
|
54
|
+
|
55
|
+
#. module: barcodes_generator_location
|
56
|
+
#: model_terms:ir.ui.view,arch_db:barcodes_generator_location.view_location_form
|
57
|
+
msgid "Generate Barcode"
|
58
|
+
msgstr ""
|
59
|
+
|
60
|
+
#. module: barcodes_generator_location
|
61
|
+
#: model_terms:ir.ui.view,arch_db:barcodes_generator_location.view_location_form
|
62
|
+
msgid "Generate Base (Using Sequence)"
|
63
|
+
msgstr ""
|
64
|
+
|
65
|
+
#. module: barcodes_generator_location
|
66
|
+
#: model:ir.model.fields,field_description:barcodes_generator_location.field_barcode_rule__generate_model
|
67
|
+
msgid "Generate Model"
|
68
|
+
msgstr ""
|
69
|
+
|
70
|
+
#. module: barcodes_generator_location
|
71
|
+
#: model:ir.model.fields,field_description:barcodes_generator_location.field_stock_location__generate_type
|
72
|
+
msgid "Generate Type"
|
73
|
+
msgstr ""
|
74
|
+
|
75
|
+
#. module: barcodes_generator_location
|
76
|
+
#: model:ir.model.fields,field_description:barcodes_generator_location.field_barcode_rule__id
|
77
|
+
#: model:ir.model.fields,field_description:barcodes_generator_location.field_stock_location__id
|
78
|
+
msgid "ID"
|
79
|
+
msgstr ""
|
80
|
+
|
81
|
+
#. module: barcodes_generator_location
|
82
|
+
#: model:ir.model.fields,help:barcodes_generator_location.field_barcode_rule__generate_model
|
83
|
+
msgid "If 'Generate Type' is set, mention the model related to this rule."
|
84
|
+
msgstr ""
|
85
|
+
|
86
|
+
#. module: barcodes_generator_location
|
87
|
+
#: model:ir.model.fields,field_description:barcodes_generator_location.field_barcode_rule____last_update
|
88
|
+
#: model:ir.model.fields,field_description:barcodes_generator_location.field_stock_location____last_update
|
89
|
+
msgid "Last Modified on"
|
90
|
+
msgstr ""
|
91
|
+
|
92
|
+
#. module: barcodes_generator_location
|
93
|
+
#: model:ir.model,name:barcodes_generator_location.model_stock_location
|
94
|
+
#: model:ir.model.fields.selection,name:barcodes_generator_location.selection__barcode_rule__generate_model__stock_location
|
95
|
+
msgid "Stock Location"
|
96
|
+
msgstr ""
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# Copyright 2017 LasLabs Inc.
|
2
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
3
|
+
from odoo import fields, models
|
4
|
+
|
5
|
+
|
6
|
+
class BarcodeRule(models.Model):
|
7
|
+
_inherit = "barcode.rule"
|
8
|
+
|
9
|
+
generate_model = fields.Selection(
|
10
|
+
selection_add=[("stock.location", "Stock Location")],
|
11
|
+
)
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# Copyright 2017 LasLabs Inc.
|
2
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
3
|
+
import json
|
4
|
+
|
5
|
+
from lxml import etree
|
6
|
+
|
7
|
+
from odoo import api, models
|
8
|
+
|
9
|
+
|
10
|
+
class StockLocation(models.Model):
|
11
|
+
_name = "stock.location"
|
12
|
+
_description = "Stock Location"
|
13
|
+
_inherit = ["stock.location", "barcode.generate.mixin"]
|
14
|
+
|
15
|
+
@api.model
|
16
|
+
def get_view(self, view_id=None, view_type="form", **options):
|
17
|
+
"""The redefinition of this method is intended to manipulating
|
18
|
+
the form view of stock.location to add the barcode field to the
|
19
|
+
view in case it has not been added by the stock_barcodes module.
|
20
|
+
"""
|
21
|
+
result = super().get_view(view_id=view_id, view_type=view_type, **options)
|
22
|
+
if view_type == "form":
|
23
|
+
doc = etree.XML(result["arch"])
|
24
|
+
barcode_field = doc.xpath("//field[@name='barcode']")
|
25
|
+
if barcode_field:
|
26
|
+
# If the field exists in the view, it's assumed it has
|
27
|
+
# been added by 'stock_barcodes' module, then all the
|
28
|
+
# fields inside 'barcodes_generator_location' group
|
29
|
+
# (added by this module) are moved next to the existing
|
30
|
+
# `barcode' field.
|
31
|
+
barcode_field = barcode_field[0]
|
32
|
+
group = doc.xpath("//group[@name='barcodes_generator_location']")[0]
|
33
|
+
for node in group.getchildren()[::-1]:
|
34
|
+
barcode_field.addnext(node)
|
35
|
+
# Remove the group since it will be empty at this point.
|
36
|
+
group.getparent().remove(group)
|
37
|
+
else:
|
38
|
+
# If the field does not exist in the view, it is added
|
39
|
+
# together with the fields that this module adds.
|
40
|
+
barcode_field = etree.Element("field", {"name": "barcode"})
|
41
|
+
placeholder = doc.xpath("//field[@name='barcode_rule_id']")[0]
|
42
|
+
placeholder.addprevious(barcode_field)
|
43
|
+
# To the `barcode` field in the view (either the new
|
44
|
+
# or the existing one), a modifier is added.
|
45
|
+
modifier = {"readonly": [("generate_type", "=", "sequence")]}
|
46
|
+
barcode_field.set("modifiers", json.dumps(modifier))
|
47
|
+
result["arch"] = etree.tostring(doc)
|
48
|
+
return result
|
@@ -0,0 +1,20 @@
|
|
1
|
+
This module expands Odoo functionality, allowing user to generate barcode
|
2
|
+
depending on a given barcode rule for Stock Locations.
|
3
|
+
|
4
|
+
For example, a typical pattern for partners is "042........." that means
|
5
|
+
that:
|
6
|
+
* the EAN13 code will begin by '042'
|
7
|
+
* followed by 0 digits (named Barcode Base in this module)
|
8
|
+
* a 13 digit control
|
9
|
+
|
10
|
+
With this module, it is possible to:
|
11
|
+
|
12
|
+
* Assign a pattern (barcode.rule) to a stock.location
|
13
|
+
|
14
|
+
* Define a Barcode base:
|
15
|
+
* manually, if the base of the barcode must be set by a user. (typically an
|
16
|
+
internal code defined in your company)
|
17
|
+
* automatically by a sequence, if you want to let Odoo to increment a
|
18
|
+
sequence. (typical case of a customer number incrementation)
|
19
|
+
|
20
|
+
* Generate a barcode, based on the defined pattern and the barcode base
|
@@ -0,0 +1,15 @@
|
|
1
|
+
To use this module, you need to:
|
2
|
+
|
3
|
+
* Go to a Stock Location form
|
4
|
+
|
5
|
+
1 for manual generation
|
6
|
+
* Set a Barcode Rule
|
7
|
+
* Set a Barcode Base
|
8
|
+
* click on the button 'Generate Barcode (Using Barcode Rule)'
|
9
|
+
|
10
|
+
2 for automatic generation
|
11
|
+
* Set a Barcode Rule
|
12
|
+
* click on the button 'Generate Base (Using Sequence)'
|
13
|
+
* click on the button 'Generate Barcode (Using Barcode Rule)'
|
14
|
+
|
15
|
+
.. image:: /barcodes_generator/static/description/stock_location_sequence_generation.png
|
Binary file
|