From 2646ac2706cd3dbd62968c52b7fb933978a786a4 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Thu, 16 Dec 2010 18:10:52 +0530 Subject: [PATCH] [FIX]PRODUCT: the ean13 check is incorrect for check digit 0 lp bug: https://launchpad.net/bugs/690763 fixed bzr revid: ron@tinyerp.com-20101216124052-pqkbymrrlm0yr8ia --- addons/product/product.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/product/product.py b/addons/product/product.py index b51a0df9c5f..ef9d9965a84 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -53,7 +53,7 @@ def check_ean(eancode): evensum += int(finalean[i]) total=(oddsum * 3) + evensum - check = int(10 - math.ceil(total % 10.0)) + check = int(10 - math.ceil(total % 10.0)) %10 if check != int(eancode[-1]): return False @@ -503,9 +503,9 @@ class product_product(osv.osv): if sellers: for s in sellers: mydict = { - 'id': product.id, - 'name': s.product_name or product.name, - 'default_code': s.product_code or product.default_code, + 'id': product.id, + 'name': s.product_name or product.name, + 'default_code': s.product_code or product.default_code, 'variants': product.variants } result.append(_name_get(mydict))