From 5c92c476d325f68611e3ea41def4e7b2d22e4eb3 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 20 Dec 2011 16:07:14 +0100 Subject: [PATCH] [FIX] share: correct login url + add action to embed url bzr revid: chs@openerp.com-20111220150714-dltvf2p1dedjo97h --- addons/share/wizard/share_wizard.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py index 92954988dcc..52f8d5c471e 100644 --- a/addons/share/wizard/share_wizard.py +++ b/addons/share/wizard/share_wizard.py @@ -95,10 +95,13 @@ class share_wizard(osv.osv_memory): # NOTE: take _ids in parameter to allow usage through browse_record objects base_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url', default='', context=context) if base_url: - base_url += '/?db=%(dbname)s&login=%(login)s' + base_url += '/web/webclient/login?db=%(dbname)s&login=%(login)s' extra = context and context.get('share_url_template_extra_arguments') if extra: base_url += '&' + '&'.join('%s=%%(%s)s' % (x,x) for x in extra) + hash_ = context and context.get('share_url_template_hash_arguments') + if hash_: + base_url += '#' + '&'.join('%s=%%(%s)s' % (x,x) for x in hash_) return base_url def _share_root_url(self, cr, uid, ids, _fieldname, _args, context=None): @@ -156,9 +159,10 @@ class share_wizard(osv.osv_memory): result = dict.fromkeys(ids, '') for this in self.browse(cr, uid, ids, context=context): if this.result_line_ids: - ctx = dict(context, share_url_template_extra_arguments=['key']) + ctx = dict(context, share_url_template_extra_arguments=['key'], + share_url_template_hash_arguments=['action_id']) user = this.result_line_ids[0] - data = dict(dbname=cr.dbname, login=user.login, key=user.password) + data = dict(dbname=cr.dbname, login=user.login, key=user.password, action_id=this.action_id.id) result[this.id] = this.share_url_template(context=ctx) % data return result