From bf5312428f4550091bbfe0fdf940330796af951a Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Fri, 16 Jun 2017 08:41:58 +0200 Subject: [PATCH] [FIX] barcodes: comply the ean parser with reportlab.graphics.barcode Before this commit, the JS parser would add 0 after the input, then add the ean key. Whereas reportlab.graphics.barcode fills the input with 0's on the left, then add the key http://pydoc.net/Python/reportlab/2.5/reportlab.graphics.barcode.eanbc/ At: Ean13BarcodeWidget.__init__() This commit makes the ean parser coherent with the lib the python uses --- addons/barcodes/static/src/js/barcode_parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/barcodes/static/src/js/barcode_parser.js b/addons/barcodes/static/src/js/barcode_parser.js index 1f804a40fea..0a356661cf6 100644 --- a/addons/barcodes/static/src/js/barcode_parser.js +++ b/addons/barcodes/static/src/js/barcode_parser.js @@ -102,7 +102,7 @@ var BarcodeParser = Class.extend({ ean = ean.substr(0,13); for(var n = 0, count = (13 - ean.length); n < count; n++){ - ean = ean + '0'; + ean = '0' + ean; } return ean.substr(0,12) + this.ean_checksum(ean); },