From 7b05292497e00111550fd69cede56ef7b1c6535e Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 12 Nov 2010 11:41:14 +0100 Subject: [PATCH] [IMP] simplify summing operation (sum builtin was added in 2.3) bzr revid: xmo@openerp.com-20101112104114-mdooszav0ox220nb --- bin/addons/base/module/module.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/addons/base/module/module.py b/bin/addons/base/module/module.py index 3dcd5b550c9..81985332157 100644 --- a/bin/addons/base/module/module.py +++ b/bin/addons/base/module/module.py @@ -53,7 +53,8 @@ class module_category(osv.osv): result = dict(cr.fetchall()) for id in ids: cr.execute('select id from ir_module_category where parent_id=%s', (id,)) - result[id] = reduce(lambda x,y:x+y, [result.get(c, 0) for (c,) in cr.fetchall()], result.get(id, 0)) + result[id] = sum([result.get(c, 0) for (c,) in cr.fetchall()], + result.get(id, 0)) return result _columns = {