[FIX] get_current_website domain check outside of cache
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user