From 920c3edcee09aba72ba1afb9820c98246b426bef Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Wed, 27 Jul 2016 12:00:12 +0200 Subject: [PATCH] [FIX] runbot: avoid 404 errors in fast_launch url for odoo >= 9 Closes https://github.com/odoo/odoo-extra/pull/104 --- runbot/runbot.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/runbot/runbot.py b/runbot/runbot.py index cbe6e042..88b48756 100644 --- a/runbot/runbot.py +++ b/runbot/runbot.py @@ -1554,8 +1554,14 @@ class RunbotController(http.Controller): if last_build.state != 'running': url = "/runbot/build/%s?ask_rebuild=1" % last_build.id else: - url = ("http://%s/login?db=%s-all&login=admin&key=admin%s" % - (last_build.domain, last_build.dest, "&redirect=/web?debug=1" if not build.branch_id.branch_name.startswith('7.0') else '')) + branch = build.branch_id.branch_name + if branch.startswith('7'): + base_url = "http://%s/login?db=%s-all&login=admin&key=admin" + elif branch.startswith('8'): + base_url = "http://%s/login?db=%s-all&login=admin&key=admin&redirect=/web?debug=1" + else: + base_url = "http://%s/web/login?db=%s-all&login=admin&redirect=/web?debug=1" + url = base_url % (last_build.domain, last_build.dest) else: return request.not_found() return werkzeug.utils.redirect(url)