[FIX] auth_signup: do not send email to duplicated user
When duplicating a user, an email was sent to a user at the email of the previous user (as the create is called before changing the email). Closes #8754
This commit is contained in:
parent
acb55e321d
commit
35b9ff7146
|
@ -279,3 +279,9 @@ class res_users(osv.Model):
|
|||
ctx = dict(context, create_user=True)
|
||||
self.action_reset_password(cr, uid, [user.id], context=ctx)
|
||||
return user_id
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
if not default or not default.get('email'):
|
||||
# avoid sending email to the user we are duplicating
|
||||
context = dict(context or {}, reset_password=False)
|
||||
return super(res_users, self).copy(cr, uid, id, default=default, context=context)
|
||||
|
|
Loading…
Reference in New Issue