[ADD]:Added Upstream patch for auth_signup

This commit is contained in:
sheetalPatil 2018-07-09 15:22:08 +05:30
parent cb0640a320
commit 21211564c3
4 changed files with 13 additions and 1 deletions

View File

@ -78,6 +78,8 @@ class AuthSignupHome(Home):
login, request.env.user.login, request.httprequest.remote_addr)
request.env['res.users'].sudo().reset_password(login)
qcontext['message'] = _("An email has been sent with credentials to reset your password")
except UserError as e:
qcontext['error'] = e.name or e.value
except SignupError:
qcontext['error'] = _("Could not reset your password")
_logger.exception('error when resetting password')

View File

@ -45,6 +45,9 @@
</div>
<div style="padding:0px;width:600px;margin:auto; margin-top: 10px; background: #fff repeat top /100%;color:#777777">
${user.signature | safe}
<p style="font-size: 11px; margin-top: 10px;">
<strong>Sent by ${user.company_id.name} using <a href="www.flectrahq.com" style="text-decoration:none; color: #875A7B;">Flectra</a></strong>
</p>
</div>]]></field>
<field name="user_signature" eval="False"/>
</record>
@ -81,6 +84,9 @@
</div>
<div style="padding:0px;width:600px;margin:auto; margin-top: 10px; background: #fff repeat top /100%;color:#777777">
${user.signature | safe}
<p style="font-size: 11px; margin-top: 10px;">
<strong>Sent by ${user.company_id.name} using <a href="www.flectrahq.com" style="text-decoration:none; color: #875A7B;">Flectra</a></strong>
</p>
</div>]]></field>
<field name="user_signature" eval="False"/>
</record>
@ -122,6 +128,9 @@
</div>
<div style="padding:0px;width:600px;margin:auto; margin-top: 10px; background: #fff repeat top /100%;color:#777777">
${user.signature | safe}
<p style="font-size: 11px; margin-top: 10px;">
<strong>Sent by ${user.company_id.name} using <a href="www.flectrahq.com" style="text-decoration:none; color: #875A7B;">Flectra</a></strong>
</p>
</div></field>
<field name="user_signature" eval="False"/>
</record>

View File

@ -32,6 +32,7 @@ class ResPartner(models.Model):
signup_url = fields.Char(compute='_compute_signup_url', string='Signup URL')
@api.multi
@api.depends('signup_token', 'signup_expiration')
def _compute_signup_valid(self):
dt = now()
for partner in self:

View File

@ -155,5 +155,5 @@ class ResUsers(models.Model):
sup = super(ResUsers, self)
if not default or not default.get('email'):
# avoid sending email to the user we are duplicating
sup = super(ResUsers, self.with_context(reset_password=False))
sup = super(ResUsers, self.with_context(no_reset_password=True))
return sup.copy(default=default)