[FIX] auth_signup, portal_sale: action_mail_redirect no longer exists

When sending the quotation email,
if the portal is enabled, as well as the signup of external users,
the action `action_mail_redirect` was used to redirect
the user at the right place, on the right form.

This action no longer exists in Odoo 9.0. This has been
replaced by the controller `/mail/view`.

opw-654007
This commit is contained in:
Denis Ledoux
2015-11-06 17:23:07 +01:00
parent 603dc8030c
commit 31dc82face
2 changed files with 9 additions and 6 deletions
+7 -4
View File
@@ -63,7 +63,10 @@ class res_partner(osv.Model):
continue # no signup token, no user, thus no signup url!
fragment = dict()
if action:
base = '/web#'
if action == '/mail/view':
base = '/mail/view?'
elif action:
fragment['action'] = action
if view_type:
fragment['view_type'] = view_type
@@ -72,10 +75,10 @@ class res_partner(osv.Model):
if model:
fragment['model'] = model
if res_id:
fragment['id'] = res_id
fragment['res_id'] = res_id
if fragment:
query['redirect'] = '/web#' + werkzeug.url_encode(fragment)
query['redirect'] = base + werkzeug.url_encode(fragment)
res[partner.id] = urljoin(base_url, "/web/%s?%s" % (route, werkzeug.url_encode(query)))
@@ -148,7 +151,7 @@ class res_partner(osv.Model):
if partner.user_ids:
res['login'] = partner.user_ids[0].login
else:
res['email'] = partner.email or ''
res['email'] = res['login'] = partner.email or ''
return res
class res_users(osv.Model):
+2 -2
View File
@@ -36,7 +36,7 @@ class sale_order(osv.Model):
document = self.browse(cr, uid, ids[0], context=context)
contex_signup = dict(context, signup_valid=True)
return self.pool['res.partner']._get_signup_url_for_action(
cr, uid, [document.partner_id.id], action='mail.action_mail_redirect',
cr, uid, [document.partner_id.id], action='/mail/view',
model=self._name, res_id=document.id, context=contex_signup,
)[document.partner_id.id]
@@ -78,7 +78,7 @@ class account_invoice(osv.Model):
document = self.browse(cr, uid, ids[0], context=context)
contex_signup = dict(context, signup_valid=True)
return self.pool['res.partner']._get_signup_url_for_action(
cr, uid, [document.partner_id.id], action='mail.action_mail_redirect',
cr, uid, [document.partner_id.id], action='/mail/view',
model=self._name, res_id=document.id, context=contex_signup,
)[document.partner_id.id]