From caba6de06e850006689ea4d318807057e97bae85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Fri, 30 Mar 2012 13:42:25 +0200 Subject: [PATCH] [imp] working weight barcodes bzr revid: rlo@openerp.com-20120330114225-iouhxmyv3hb3xbcd --- addons/point_of_sale/static/src/js/pos.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 98930e284cd..4b63740c9f9 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1339,14 +1339,12 @@ openerp.point_of_sale = function(db) { } else if (barcode.substring(0,2) in {'21':'','23':'','27':'','29':'','25':''}) { // WEIGHT barcode weight = Number(barcode.substring(7,12))/1000; - console.log(weight); barcode = barcode.substring(0,7); var scannedPackaging = _.detect(allPackages, function(pack) { return pack.ean !== undefined && pack.ean.substring(0,7) === barcode;}); if (scannedPackaging !== undefined) { - var scannedProductModel = _.detect(allProducts, function(pc) { return pc.ean13 === scannedPackaging.product_id[0];}); - console.log(scannedProductModel.price); - scannedProductModel.price *= weight; - console.log(weight); + var scannedProductModel = _.detect(allProducts, function(pc) { return pc.id === scannedPackaging.product_id[0];}); + scannedProductModel.list_price *= weight; + scannedProductModel.name += ' - ' + weight + ' Kg.' } } else { // UNIT barcode