Skip to content
Snippets Groups Projects
Commit 5ac61bcbc5f5 authored by Houzefa Abbasbhay's avatar Houzefa Abbasbhay :slight_smile:
Browse files

Don't clear out the pass of the Odoo admin.

Suggested by petrus-v on <https://github.com/OCA/server-tools/pull/274>.
parent 12b7ff5c71cf
No related branches found
No related tags found
No related merge requests found
......@@ -262,8 +262,15 @@
ID (as they can't cohabit).
"""
if vals and vals.get('saml_uid'):
if not self._allow_saml_and_password():
# Clear out the pass when:
# - An SAML ID is being set.
# - The user is not the Odoo admin.
# - The "allow both" setting is disabled.
if (
vals and vals.get('saml_uid') and
self.id is not SUPERUSER_ID and
not self._allow_saml_and_password()
):
vals.update({
'password': False,
'password_crypt': False,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment