[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:
parent
1ea7171ae9
commit
699a332377
|
@ -249,3 +249,11 @@ class res_users(osv.Model):
|
||||||
self.pool.get('email.template').send_mail(cr, uid, template.id, user.id, context=context)
|
self.pool.get('email.template').send_mail(cr, uid, template.id, user.id, context=context)
|
||||||
|
|
||||||
return True
|
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
|
||||||
|
|
Loading…
Reference in New Issue