From 81c26383b0ce7a977d990e818bedb56c81abf3be Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 4 Dec 2018 12:13:39 +0000 Subject: [FIX] auth_ldap: Avoid sending email for newly created user If installed along with `auth_signup`, it sends an email when creating a missing user authenticated through LDAP. It is a confusing message that makes no sense, because the user is, from his POV, not actually creating a new user, but just authenticating with a new app with his known company-wide credentials. Besides, that invitation leads the user to change his password in Odoo, although he probably doesn't want to do that and have a password for Odoo and another in the LDAP server. The best option is to disable that email completely, which is what this commit does. closes odoo/odoo#29243 --- addons/auth_ldap/models/res_company_ldap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/auth_ldap') diff --git a/addons/auth_ldap/models/res_company_ldap.py b/addons/auth_ldap/models/res_company_ldap.py index 05dcb275afa..effea64a67b 100644 --- a/addons/auth_ldap/models/res_company_ldap.py +++ b/addons/auth_ldap/models/res_company_ldap.py @@ -193,7 +193,7 @@ class CompanyLDAP(models.Model): elif conf['create_user']: _logger.debug("Creating new Odoo user \"%s\" from LDAP" % login) values = self.map_ldap_attributes(conf, login, ldap_entry) - SudoUser = self.env['res.users'].sudo() + SudoUser = self.env['res.users'].sudo().with_context(no_reset_password=True) if conf['user']: values['active'] = True user_id = SudoUser.browse(conf['user'][0]).copy(default=values).id -- cgit v1.2.3