[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:
Martin Trigaux 2015-10-02 16:32:55 +02:00
parent acb55e321d
commit 35b9ff7146
1 changed files with 6 additions and 0 deletions

View File

@ -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)