parameters: (self)
docstring: Do not allow two users with the same login without website
docstring_summary: Do not allow two users with the same login without website
docstring_tokens: Do not allow two users with the same login without website
function: def _check_login(self):
          """ Do not allow two users with the same login without website """
          self.flush(['login', 'website_id'])
          self.env.cr.execute(
              """SELECT login
                   FROM res_users
                  WHERE login IN (SELECT login FROM res_users WHERE id IN %s AND website_id IS NULL)
                    AND website_id IS NULL
               GROUP BY login
                 HAVING COUNT(*) > 1
              """,
              (tuple(self.ids),)
          )
          if self.env.cr.rowcount:
              raise ValidationError(_('You can not have two users with the same login!'))
function_tokens: def _check_login ( self ) : self . flush ( [ 'login' , 'website_id' ] ) self . env . cr . execute ( """SELECT login
                   FROM res_users
                  WHERE login IN (SELECT login FROM res_users WHERE id IN %s AND website_id IS NULL)
                    AND website_id IS NULL
               GROUP BY login
                 HAVING COUNT(*) > 1
              """ , ( tuple ( self . ids ) , ) ) if self . env . cr . rowcount : raise ValidationError ( _ ( 'You can not have two users with the same login!' ) )