[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)
This commit is contained in:
Xavier Morel
2015-04-10 18:23:31 +02:00
committed by Olivier Dony
parent b03b7280b3
commit 298ef06b98
+1 -1
View File
@@ -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: