[IMP] simplify summing operation (sum builtin was added in 2.3)

bzr revid: xmo@openerp.com-20101112104114-mdooszav0ox220nb
This commit is contained in:
Xavier Morel
2010-11-12 11:41:14 +01:00
parent 1fff5e28f1
commit 7b05292497
+2 -1
View File
@@ -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 = {