diff --git a/auth_user_case_insensitive/README.rst b/auth_user_case_insensitive/README.rst index 1022a625d8..0cb6aae9ac 100644 --- a/auth_user_case_insensitive/README.rst +++ b/auth_user_case_insensitive/README.rst @@ -14,13 +14,13 @@ Case Insensitive Logins :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--auth-lightgray.png?logo=github - :target: https://github.com/OCA/server-auth/tree/13.0/auth_user_case_insensitive + :target: https://github.com/OCA/server-auth/tree/14.0/auth_user_case_insensitive :alt: OCA/server-auth .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/server-auth-13-0/server-auth-13-0-auth_user_case_insensitive + :target: https://translation.odoo-community.org/projects/server-auth-14-0/server-auth-14-0-auth_user_case_insensitive :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/251/13.0 + :target: https://runbot.odoo-community.org/runbot/251/14.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -54,7 +54,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -87,6 +87,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/server-auth `_ project on GitHub. +This module is part of the `OCA/server-auth `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/auth_user_case_insensitive/__init__.py b/auth_user_case_insensitive/__init__.py index 863cc8117b..f16bb110a5 100644 --- a/auth_user_case_insensitive/__init__.py +++ b/auth_user_case_insensitive/__init__.py @@ -1,4 +1,5 @@ # Copyright 2015-2017 LasLabs Inc. +# Copyright 2021 Open Source Integrators # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). from . import models diff --git a/auth_user_case_insensitive/__manifest__.py b/auth_user_case_insensitive/__manifest__.py index c809f2132c..00d1d4b864 100644 --- a/auth_user_case_insensitive/__manifest__.py +++ b/auth_user_case_insensitive/__manifest__.py @@ -1,9 +1,10 @@ # Copyright 2015-2017 LasLabs Inc. +# Copyright 2021 Open Source Integrators # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). { "name": "Case Insensitive Logins", "summary": "Makes the user login field case insensitive", - "version": "13.0.1.0.0", + "version": "14.0.1.0.0", "category": "Authentication", "website": "https://github.com/OCA/server-auth", "author": "LasLabs, Odoo Community Association (OCA)", diff --git a/auth_user_case_insensitive/hooks.py b/auth_user_case_insensitive/hooks.py index 10bb240220..c6f43236d4 100644 --- a/auth_user_case_insensitive/hooks.py +++ b/auth_user_case_insensitive/hooks.py @@ -1,4 +1,5 @@ # Copyright 2017 LasLabs Inc. +# Copyright 2021 Open Source Integrators # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). from odoo import _ diff --git a/auth_user_case_insensitive/models/__init__.py b/auth_user_case_insensitive/models/__init__.py index af0a373aab..e5a2663b80 100644 --- a/auth_user_case_insensitive/models/__init__.py +++ b/auth_user_case_insensitive/models/__init__.py @@ -1,4 +1,5 @@ # Copyright 2015-2017 LasLabs Inc. +# Copyright 2021 Open Source Integrators # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). from . import res_users diff --git a/auth_user_case_insensitive/models/res_users.py b/auth_user_case_insensitive/models/res_users.py index 0dae242b2a..1d0569cb26 100644 --- a/auth_user_case_insensitive/models/res_users.py +++ b/auth_user_case_insensitive/models/res_users.py @@ -1,4 +1,5 @@ # Copyright 2015-2017 LasLabs Inc. +# Copyright 2021 Open Source Integrators # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). from odoo import api, fields, models @@ -11,11 +12,13 @@ class ResUsers(models.Model): login = fields.Char(help="Used to log into the system. Case insensitive.") @classmethod - def _login(cls, db, login, password): - """ Overload _login to lowercase the `login` before passing to the - super """ + def _login(cls, db, login, password, user_agent_env): + """Overload _login to lowercase the `login` before passing to the + super""" login = login.lower() - return super(ResUsers, cls)._login(db, login, password) + return super(ResUsers, cls)._login( + db, login, password, user_agent_env=user_agent_env + ) @api.model_create_multi def create(self, vals_list): diff --git a/auth_user_case_insensitive/tests/__init__.py b/auth_user_case_insensitive/tests/__init__.py index 1673add8ed..6b32764e31 100644 --- a/auth_user_case_insensitive/tests/__init__.py +++ b/auth_user_case_insensitive/tests/__init__.py @@ -1,4 +1,5 @@ # Copyright 2015-2017 LasLabs Inc. +# Copyright 2021 Open Source Integrators # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). from . import test_res_users diff --git a/auth_user_case_insensitive/tests/test_res_users.py b/auth_user_case_insensitive/tests/test_res_users.py index e218ae0f58..c18741b4ce 100644 --- a/auth_user_case_insensitive/tests/test_res_users.py +++ b/auth_user_case_insensitive/tests/test_res_users.py @@ -1,4 +1,5 @@ # Copyright 2015-2017 LasLabs Inc. +# Copyright 2021 Open Source Integrators # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). from odoo import api, registry @@ -50,7 +51,10 @@ def test_login_login_is_lowercased(self): self.env.cr.commit() with mute_logger("odoo.addons.auth_ldap.models.res_company_ldap"): res_id = self.model_obj._login( - self.env.registry.db_name, self.login.upper(), "password" + self.env.registry.db_name, + self.login.upper(), + "password", + {"interactive": True}, ) # Now clean up our mess to preserve idempotence with api.Environment.manage():