diff options
| author | Christophe Simonis <chs@odoo.com> | 2014-06-01 14:30:15 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2014-06-01 14:30:15 +0200 |
| commit | c19bb8ce488639eb8dcdf6f506caad96db381223 (patch) | |
| tree | a9ef583acf5bfe803d48519022e1991339e8be35 /addons | |
| parent | 587084f6826cf157315bca88bdde637f8e9ba055 (diff) | |
[FIX] website: correct "/" redirect to first menu
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/website/controllers/main.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py index 0a2a5ed1397..e7a9350f8ba 100644 --- a/addons/website/controllers/main.py +++ b/addons/website/controllers/main.py @@ -32,14 +32,16 @@ class Website(openerp.addons.web.controllers.main.Home): page = 'homepage' try: main_menu = request.registry['ir.model.data'].get_object(request.cr, request.uid, 'website', 'main_menu') + except Exception: + pass + else: first_menu = main_menu.child_id and main_menu.child_id[0] if first_menu: if not (first_menu.url.startswith(('/page/', '/?', '/#')) or (first_menu.url=='/')): return request.redirect(first_menu.url) if first_menu.url.startswith('/page/'): - page = first_menu[6:] - except: - pass + page = first_menu.url[6:] + return self.page(page) @http.route(website=True, auth="public") |
