From 7be131af9a6e0807bebfa63269672417bedf2fd1 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 15 Sep 2014 10:04:17 +0200 Subject: [PATCH] [FIX] get_current_website domain check outside of cache --- addons/website/models/website.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/website/models/website.py b/addons/website/models/website.py index a5062b162a7..c801b66b186 100644 --- a/addons/website/models/website.py +++ b/addons/website/models/website.py @@ -252,17 +252,17 @@ class website(osv.osv): return langs @openerp.tools.ormcache(skiparg=4) - def _get_current_website_id(self, cr, uid, context=None): + def _get_current_website_id(self, cr, uid, domain_name, context=None): website_id = 1 if request: - domain_name = request.httprequest.environ.get('HTTP_HOST', '').split(':')[0] ids = self.search(cr, uid, [('name', '=', domain_name)], context=context) if ids: website_id = ids[0] return website_id def get_current_website(self, cr, uid, context=None): - website_id = self._get_current_website_id(cr, uid, context=context) + domain_name = request.httprequest.environ.get('HTTP_HOST', '').split(':')[0] + website_id = self._get_current_website_id(cr, uid, domain_name, context=context) return self.browse(cr, uid, website_id, context=context) def is_publisher(self, cr, uid, ids, context=None):