# HG changeset patch
# User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr>
# Date 1433420648 -7200
#      Thu Jun 04 14:24:08 2015 +0200
# Node ID 7324a07438eeee1bce6953ff1e8e2e69b44b3194
# Parent  24a71db8c2652ac8562b55144018d423f6972774
admin can have a password on top of saml connection

diff --git a/NEWS b/NEWS
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,8 @@
+next
+====
+
+* admin can have a password on top of saml connection.
+
 next
 ====
 
diff --git a/model/res_users.py b/model/res_users.py
--- a/model/res_users.py
+++ b/model/res_users.py
@@ -28,7 +28,7 @@
         password.
         """
 
-        if self._allow_saml_uid_and_internal_password(cr, context):
+        if self._allow_saml_uid_and_internal_password(cr, uid, context):
             # The constraint is a no-op in this case.
             return True
 
@@ -212,7 +212,9 @@
             cr, uid, ids, vals, context=context
         )
 
-    def _allow_saml_uid_and_internal_password(self, cr, context):
+    def _allow_saml_uid_and_internal_password(self, cr, uid, context):
+        if uid == SUPERUSER_ID:
+            return true
         setting_obj = self.pool['base.config.settings']
         return setting_obj.allow_saml_uid_and_internal_password(
             cr, context=context