summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2015-11-06 15:25:10 +0100
committerDenis Ledoux <dle@odoo.com>2015-11-06 17:23:07 +0100
commit31dc82face1fce75a1cd61bcc7f96d7e0f1f4eeb (patch)
tree6d61d1989859e42d38e4e80b9e31b0ddc0976e79
parent603dc8030c7c055c0b0f9c65d69d06729f15b5bf (diff)
[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
-rw-r--r--addons/auth_signup/res_users.py11
-rw-r--r--addons/portal_sale/portal_sale.py4
2 files changed, 9 insertions, 6 deletions
diff --git a/addons/auth_signup/res_users.py b/addons/auth_signup/res_users.py
index b9912fcc365..eab3fbe9877 100644
--- a/addons/auth_signup/res_users.py
+++ b/addons/auth_signup/res_users.py
@@ -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):
diff --git a/addons/portal_sale/portal_sale.py b/addons/portal_sale/portal_sale.py
index c422c7ac57e..7cdc783769b 100644
--- a/addons/portal_sale/portal_sale.py
+++ b/addons/portal_sale/portal_sale.py
@@ -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]