[IMP] auth_signup: automatically invite new users to set their password (if they have an email address)

bzr revid: rco@openerp.com-20121203155757-a93sl67rubl3eoov
This commit is contained in:
Raphael Collet 2012-12-03 16:57:57 +01:00
parent 1ea7171ae9
commit 699a332377
1 changed files with 8 additions and 0 deletions

View File

@ -249,3 +249,11 @@ class res_users(osv.Model):
self.pool.get('email.template').send_mail(cr, uid, template.id, user.id, context=context)
return True
def create(self, cr, uid, values, context=None):
# overridden to automatically invite user to sign up
user_id = super(res_users, self).create(cr, uid, values, context=context)
user = self.browse(cr, uid, user_id, context=context)
if user.email:
user.action_reset_password()
return user_id