[IMP] simplify summing operation (sum builtin was added in 2.3)
bzr revid: xmo@openerp.com-20101112104114-mdooszav0ox220nb
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user