mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[FIX] runbot: avoid error when there is no build
This commit is contained in:
parent
e1161a03e6
commit
a672088acf
@ -495,6 +495,8 @@ class Runbot(Controller):
|
|||||||
limit -= len(builds)
|
limit -= len(builds)
|
||||||
|
|
||||||
builds |= builds.search(builds_domain, order='id desc', limit=limit)
|
builds |= builds.search(builds_domain, order='id desc', limit=limit)
|
||||||
|
if not builds:
|
||||||
|
return {}
|
||||||
|
|
||||||
builds = builds.search([('id', 'child_of', builds.ids)])
|
builds = builds.search([('id', 'child_of', builds.ids)])
|
||||||
|
|
||||||
@ -502,7 +504,8 @@ class Runbot(Controller):
|
|||||||
request.env.cr.execute("SELECT build_id, values FROM runbot_build_stat WHERE build_id IN %s AND category = %s", [tuple(builds.ids), key_category]) # read manually is way faster than using orm
|
request.env.cr.execute("SELECT build_id, values FROM runbot_build_stat WHERE build_id IN %s AND category = %s", [tuple(builds.ids), key_category]) # read manually is way faster than using orm
|
||||||
res = {}
|
res = {}
|
||||||
for (build_id, values) in request.env.cr.fetchall():
|
for (build_id, values) in request.env.cr.fetchall():
|
||||||
res.setdefault(parents[build_id], {}).update(values)
|
if values:
|
||||||
|
res.setdefault(parents[build_id], {}).update(values)
|
||||||
# we need to update here to manage the post install case: we want to combine stats from all post_install childrens.
|
# we need to update here to manage the post install case: we want to combine stats from all post_install childrens.
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user