[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:
committed by
Olivier Dony
parent
b03b7280b3
commit
298ef06b98
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user