[FIX] website: possibility to set no url for the home menu

Unsetting the URL of the menu `Home`,
in Settings > Configuration > Website Settings > Configure Website,
leaded to the unavailability of the website.

opw-657572
This commit is contained in:
Denis Ledoux 2015-11-26 10:02:41 +01:00
parent 5c0fd9780e
commit b459c4dc03
1 changed files with 2 additions and 2 deletions

View File

@ -40,9 +40,9 @@ class Website(openerp.addons.web.controllers.main.Home):
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=='/')):
if first_menu.url and (not (first_menu.url.startswith(('/page/', '/?', '/#')) or (first_menu.url == '/'))):
return request.redirect(first_menu.url)
if first_menu.url.startswith('/page/'):
if first_menu.url and first_menu.url.startswith('/page/'):
return request.registry['ir.http'].reroute(first_menu.url)
return self.page(page)