diff --git a/auth_saml/models/res_users_saml.py b/auth_saml/models/res_users_saml.py index d7cbd308d3..5ac04f9477 100644 --- a/auth_saml/models/res_users_saml.py +++ b/auth_saml/models/res_users_saml.py @@ -32,5 +32,6 @@ def create(self, vals_list): # Redefined to remove password if necessary result = super().create(vals_list) if not self.env["res.users"].allow_saml_and_password(): - result.mapped("user_id").write({"password": False}) + # Avoid sending a security mail by using this method instead of a write + result.mapped("user_id")._set_password_blank() return result diff --git a/auth_saml/readme/newsfragments/+no-password-mail.bugfix.rst b/auth_saml/readme/newsfragments/+no-password-mail.bugfix.rst new file mode 100644 index 0000000000..bb06705aec --- /dev/null +++ b/auth_saml/readme/newsfragments/+no-password-mail.bugfix.rst @@ -0,0 +1 @@ +Fix sending a mail when configuring SAML for a user.