From acffd62e3db16aa073d16c396d0e5148113d6b20 Mon Sep 17 00:00:00 2001 From: Frederic van der Essen Date: Wed, 1 Oct 2014 13:40:02 +0200 Subject: [PATCH] [IMP] pos_barcodes: fix some wrongly named variables, fix missing barcode nomenclature field in pos config, 'unit' type renamed to 'product' to fit with the existing keywords --- addons/pos_barcodes/barcodes.py | 4 ++-- addons/pos_barcodes/barcodes_view.xml | 14 +++++++++++++- addons/pos_barcodes/static/src/js/barcodes.js | 4 ++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/addons/pos_barcodes/barcodes.py b/addons/pos_barcodes/barcodes.py index 492f573e86f..370b28d64ac 100644 --- a/addons/pos_barcodes/barcodes.py +++ b/addons/pos_barcodes/barcodes.py @@ -44,13 +44,13 @@ class barcode_rule(osv.osv): 'barcode_nomenclature_id': fields.many2one('barcode.nomenclature','Barcode Nomenclature'), 'priority': fields.float('Priority', help='Rules with a higher priority match first'), #'encoding': fields.selection([('any','Any'),('ean13','EAN-13'),('ean8','EAN-8'),('codabar','Codabar'),('upca','UPC-A'),('upce','UPC-E')],'Encoding',help='This rule will apply only if the barcode is encoded with the specified encoding'), - 'type': fields.selection([('unit','Unit Product'),('weight','Weighted Product'),('price','Priced Product'),('discount','Discounted Product'),('client','Client'),('cashier','Cashier')],'Type', required=True), + 'type': fields.selection([('product','Unit Product'),('weight','Weighted Product'),('price','Priced Product'),('discount','Discounted Product'),('client','Client'),('cashier','Cashier')],'Type', required=True), 'pattern': fields.char('Barcode Pattern', size=32, help="The barcode matching pattern"), #'alias': fields.char('Alias',size=32,help='The matched pattern will alias to this barcode'), } _defaults = { - 'type': 'unit', + 'type': 'product', 'pattern': '*', #'encoding': 'any', } diff --git a/addons/pos_barcodes/barcodes_view.xml b/addons/pos_barcodes/barcodes_view.xml index 30e6b237bce..2d0ba209d89 100644 --- a/addons/pos_barcodes/barcodes_view.xml +++ b/addons/pos_barcodes/barcodes_view.xml @@ -2,6 +2,19 @@ + + pos.config.form.view + pos.config + + + + + + + + + + @@ -75,6 +88,5 @@ sequence="30" groups="point_of_sale.group_pos_manager"/> - diff --git a/addons/pos_barcodes/static/src/js/barcodes.js b/addons/pos_barcodes/static/src/js/barcodes.js index 460a12c7e97..d3e0717e431 100644 --- a/addons/pos_barcodes/static/src/js/barcodes.js +++ b/addons/pos_barcodes/static/src/js/barcodes.js @@ -110,8 +110,8 @@ openerp.pos_barcodes = function(instance){ for (var i = 0; i < rules.length; i++) { if (match_pattern(ean,rules[i].pattern)) { parse_result.type = rules[i].type; - parse_result.value = get_value(ean,patterns[i].pattern); - parse_result.base_code = get_basecode(ean,patterns[i].pattern); + parse_result.value = get_value(ean,rules[i].pattern); + parse_result.base_code = get_basecode(ean,rules[i].pattern); return parse_result; } }