From 298ef06b98f85182b4fa7a736465bfa4dbf19979 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 27 Mar 2015 11:01:49 +0100 Subject: [PATCH] [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) --- addons/website/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: