From fca2f5ce31f6d72faffcced9345ea87ebe8dddae Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 30 Sep 2014 14:05:02 +0200 Subject: [PATCH] [FIX] im_livechat: ir.config_parameter must be read as superuser As ir.config_parameter is restricted to employees in ACL, for security reasons --- addons/im_livechat/im_livechat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/im_livechat/im_livechat.py b/addons/im_livechat/im_livechat.py index cfc6bb9ce8e..5925084f4ee 100644 --- a/addons/im_livechat/im_livechat.py +++ b/addons/im_livechat/im_livechat.py @@ -107,7 +107,7 @@ class im_livechat_channel(osv.osv): res = {} for record in self.browse(cr, uid, ids, context=context): res[record.id] = env.get_template("include.html").render({ - "url": self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url'), + "url": self.pool.get('ir.config_parameter').get_param(cr, openerp.SUPERUSER_ID, 'web.base.url'), "parameters": {"db":cr.dbname, "channel":record.id}, }) return res @@ -115,7 +115,7 @@ class im_livechat_channel(osv.osv): def _web_page(self, cr, uid, ids, name, arg, context=None): res = {} for record in self.browse(cr, uid, ids, context=context): - res[record.id] = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url') + \ + res[record.id] = self.pool.get('ir.config_parameter').get_param(cr, openerp.SUPERUSER_ID, 'web.base.url') + \ "/im_livechat/web_page?p=" + json.dumps({"db":cr.dbname, "channel":record.id}) return res