[FIX] auth_signup: Error when sending quotation
Fine tuning of this commit:https://github.com/odoo/odoo/commit/7501691da9a9dae832b7d6e78c6a5f57fc983b5c 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
This commit is contained in:
@@ -59,17 +59,17 @@ class ResPartner(models.Model):
|
|||||||
for partner in self:
|
for partner in self:
|
||||||
# when required, make sure the partner has a valid signup token
|
# when required, make sure the partner has a valid signup token
|
||||||
if self.env.context.get('signup_valid') and not partner.user_ids:
|
if self.env.context.get('signup_valid') and not partner.user_ids:
|
||||||
partner.signup_prepare()
|
partner.sudo().signup_prepare()
|
||||||
|
|
||||||
route = 'login'
|
route = 'login'
|
||||||
# the parameters to encode for the query
|
# the parameters to encode for the query
|
||||||
query = dict(db=self.env.cr.dbname)
|
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:
|
if signup_type:
|
||||||
route = 'reset_password' if signup_type == 'reset' else signup_type
|
route = 'reset_password' if signup_type == 'reset' else signup_type
|
||||||
|
|
||||||
if partner.signup_token and signup_type:
|
if partner.sudo().signup_token and signup_type:
|
||||||
query['token'] = partner.signup_token
|
query['token'] = partner.sudo().signup_token
|
||||||
elif partner.user_ids:
|
elif partner.user_ids:
|
||||||
query['login'] = partner.user_ids[0].login
|
query['login'] = partner.user_ids[0].login
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user