From 29badc35a54e00f0ca0d516473eb82016d2b9355 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Mon, 24 Sep 2012 13:16:41 +0200 Subject: [PATCH] [FIX] product: 'Nonetype object has no len()' error fixed in newly added constraints for decimal precision of 'Account' <= company's main currency rounding bzr revid: qdp-launchpad@openerp.com-20120924111641-9papztx074vdbrpq --- addons/product/product.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/product/product.py b/addons/product/product.py index 144aa28c458..df0ab9122c2 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -904,7 +904,7 @@ class res_currency(osv.osv): def _check_main_currency_rounding(self, cr, uid, ids, context=None): cr.execute('SELECT digits FROM decimal_precision WHERE name like %s',('Account',)) digits = cr.fetchone() - if len(digits): + if digits and len(digits): digits = digits[0] main_currency = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id for currency_id in ids: @@ -923,7 +923,7 @@ class decimal_precision(osv.osv): def _check_main_currency_rounding(self, cr, uid, ids, context=None): cr.execute('SELECT id, digits FROM decimal_precision WHERE name like %s',('Account',)) res = cr.fetchone() - if len(res): + if res and len(res): account_precision_id, digits = res main_currency = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id for decimal_precision in ids: