diff --git a/barcodes/__openerp__.py b/barcodes/__openerp__.py index d42111cc..4d39e2db 100644 --- a/barcodes/__openerp__.py +++ b/barcodes/__openerp__.py @@ -11,6 +11,21 @@ 'description': """ This module adds support for barcode scanning and parsing. +Backport Note +------------- +This module is a backport of Odoo 9.0 modules. It has been done to have +a module in V8 that have the same models barcode, nomenclatures, rules than +in V9.0 and same rules (same xml_ids). + +Data comes from stock, point_of_sale and barcodes V9.0 modules. + +The following changes has been done: +- copyright has been added to Odoo SA in the header and licence LGPLv3 has been mentionned +- noqa has been set for all py files, to avoid to break OCA rules checked by Travis + +The following features has not been backported +- JS features. See views/templates.xml for mor details. + Scanning -------- Use a USB scanner (that mimics keyboard inputs) in order to work with barcodes in Odoo. @@ -28,13 +43,15 @@ It provides the following features: - Patterns to identify barcodes containing a numerical value (e.g. weight, price) - Definition of barcode aliases that allow to identify the same product with different barcodes - Support for encodings EAN-13, EAN-8 and UPC-A + """, - 'depends': ['web'], + 'depends': ['web', 'stock', 'point_of_sale'], 'data': [ 'data/barcodes_data.xml', + 'data/default_barcode_patterns.xml', 'barcodes_view.xml', 'security/ir.model.access.csv', - 'views/templates.xml', + # 'views/templates.xml', ], 'installable': True, 'auto_install': False, diff --git a/barcodes/barcodes.py b/barcodes/barcodes.py index f4df0e2e..6ee6cdf8 100644 --- a/barcodes/barcodes.py +++ b/barcodes/barcodes.py @@ -193,7 +193,18 @@ class barcode_rule(models.Model): @api.model def _get_type_selection(self): - return [('alias', _('Alias')), ('product', _('Unit Product'))] + return [('alias', _('Alias')), ('product', _('Unit Product')), + # Backport Note : come from point_of_sale V9.0 module + ('weight', _('Weighted Product')), + ('price', _('Priced Product')), + ('discount', _('Discounted Product')), + ('client', _('Client')), + ('cashier', _('Cashier')), + # Backport Note : come from stock V9.0 module + ('location', _('Location')), + ('lot', _('Lot')), + ('package', _('Package')), + ] _columns = { 'name': fields.char('Rule Name', size=32, required=True, help='An internal identification for this barcode nomenclature rule'), diff --git a/barcodes/barcodes_view.xml b/barcodes/barcodes_view.xml index 06ae009e..fba23641 100644 --- a/barcodes/barcodes_view.xml +++ b/barcodes/barcodes_view.xml @@ -82,5 +82,11 @@ + + + + + diff --git a/barcodes/data/default_barcode_patterns.xml b/barcodes/data/default_barcode_patterns.xml new file mode 100644 index 00000000..630f510a --- /dev/null +++ b/barcodes/data/default_barcode_patterns.xml @@ -0,0 +1,79 @@ + + + + + + Cashier Barcodes + + 50 + cashier + any + 041 + + + + Customer Barcodes + + 40 + client + any + 042 + + + + Discount Barcodes + + 20 + discount + any + 22{NN} + + + + Price Barcodes 2 Decimals + + 14 + price + ean13 + 23.....{NNNDD} + + + + + Weight Barcodes 3 Decimals + + 36 + weight + ean13 + 21.....{NNDDD} + + + + Package barcodes + + 70 + package + any + PACK + + + + Lot barcodes + + 80 + lot + any + 10 + + + + Location barcodes + + 60 + location + any + 414 + + + + diff --git a/barcodes/static/src/description/barcode_nomenclature.png b/barcodes/static/src/description/barcode_nomenclature.png new file mode 100644 index 00000000..f2b32512 Binary files /dev/null and b/barcodes/static/src/description/barcode_nomenclature.png differ