summaryrefslogtreecommitdiff
path: root/addons/website/controllers/main.py
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2015-03-27 11:01:49 +0100
committerOlivier Dony <odo@openerp.com>2015-04-10 18:23:31 +0200
commit298ef06b98f85182b4fa7a736465bfa4dbf19979 (patch)
tree78e136e156664bb71feb614b6b92d3528237e12e /addons/website/controllers/main.py
parentb03b7280b3a3c31b91f26d3a50894af95760b079 (diff)
[IMP] website: use env.ref to ensure main_menu is fetched w/ correct environment
By using get_object and not passing in the request's context, creates a divergent environment from the one used in the rest of the request, resulting to the cached menu items not being reused when displaying the menu in the page (during qweb rendering), saves ~4 requests on the index page (though probably nothing elsewhere)
Diffstat (limited to 'addons/website/controllers/main.py')
-rw-r--r--addons/website/controllers/main.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py
index dadc6b979fd..20f18e1ed79 100644
--- a/addons/website/controllers/main.py
+++ b/addons/website/controllers/main.py
@@ -34,7 +34,7 @@ class Website(openerp.addons.web.controllers.main.Home):
def index(self, **kw):
page = 'homepage'
try:
- main_menu = request.registry['ir.model.data'].get_object(request.cr, request.uid, 'website', 'main_menu')
+ main_menu = request.env.ref('website.main_menu')
except Exception:
pass
else: