summaryrefslogtreecommitdiff
path: root/addons/plugin/plugin_handler.py
diff options
context:
space:
mode:
authorRaphael Collet <rco@openerp.com>2011-12-22 14:00:00 +0100
committerRaphael Collet <rco@openerp.com>2011-12-22 14:00:00 +0100
commit18494dd6937b7eda740ff0556456fbc16dac42e2 (patch)
tree064f6f06ce6069ec44b19f3921329f4ca4d94cb8 /addons/plugin/plugin_handler.py
parent87ba81c4d72bd547f492991a0832c99220b5d159 (diff)
parentfd7c6686bb70bca2b8b3bb77694c8d051c62e20a (diff)
[MERGE] from trunk
bzr revid: rco@openerp.com-20111222130000-0j8mizyj3sbik5ot
Diffstat (limited to 'addons/plugin/plugin_handler.py')
-rw-r--r--addons/plugin/plugin_handler.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/plugin/plugin_handler.py b/addons/plugin/plugin_handler.py
index fd5ca7da6c6..1fccae814b2 100644
--- a/addons/plugin/plugin_handler.py
+++ b/addons/plugin/plugin_handler.py
@@ -12,13 +12,14 @@ class plugin_handler(osv.osv_memory):
def _make_url(self, cr, uid, res_id, model, context=None):
"""
- @param id: on which document the message is pushed
+ @param res_id: on which document the message is pushed
@param model: name of the document linked with the mail
@return url
"""
base_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url', default='http://localhost:8069', context=context)
if base_url:
- base_url += '/?id=%s&model=%s'%(res_id,model)
+ user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
+ base_url += '/web/webclient/login?db=%s&login=%s&key=%s#id=%s&model=%s' % (cr.dbname, user.login, user.password, res_id, model)
return base_url
def is_installed(self, cr, uid):
@@ -53,7 +54,7 @@ class plugin_handler(osv.osv_memory):
res_id = msg.res_id
model = msg.model
url = self._make_url(cr, uid, res_id, model)
- name = self.pool.get(model).name_get(cr, uid, res_id)[0][1]
+ name = self.pool.get(model).name_get(cr, uid, [res_id])[0][1]
return (model,res_id, url,name)