Skip to content

Commit

Permalink
[FIX] auth_signup: Error when sending quotation
Browse files Browse the repository at this point in the history
Fine tuning of this commit:odoo@7501691
Fields signup_token, signup_type, signup_expiration are protected
When sending a quotation (mail template 'Sales Order - Send by Email'):
the token needs to be read (and sometimes written)

opw:1907157
  • Loading branch information
mao-odoo authored and simongoffin committed Nov 15, 2018
1 parent 8cdfe1d commit 8a9569b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions addons/auth_signup/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@ def _get_signup_url_for_action(self, action=None, view_type=None, menu_id=None,
for partner in self:
# when required, make sure the partner has a valid signup token
if self.env.context.get('signup_valid') and not partner.user_ids:
partner.signup_prepare()
partner.sudo().signup_prepare()

route = 'login'
# the parameters to encode for the query
query = dict(db=self.env.cr.dbname)
signup_type = self.env.context.get('signup_force_type_in_url', partner.signup_type or '')
signup_type = self.env.context.get('signup_force_type_in_url', partner.sudo().signup_type or '')
if signup_type:
route = 'reset_password' if signup_type == 'reset' else signup_type

if partner.signup_token and signup_type:
query['token'] = partner.signup_token
if partner.sudo().signup_token and signup_type:
query['token'] = partner.sudo().signup_token
elif partner.user_ids:
query['login'] = partner.user_ids[0].login
else:
Expand Down

0 comments on commit 8a9569b

Please sign in to comment.