Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] auth_user_case_insensitive: Migration to 17.0 #607

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
7797b16
[IMP] auth_user_case_insensitive: Update module name
May 8, 2017
159b995
[IMP] auth_user_case_insensitive: Drop `search()` override in favor o…
May 9, 2017
3dadbe3
Note that existing logins are converted to lowercase
dreispt May 15, 2017
92fd768
OCA Transbot updated translations from Transifex
oca-transbot May 20, 2017
8ee1931
[UPD] Update auth_user_case_insensitive.pot
oca-travis Jun 24, 2018
966b146
[FIX/IMP] Fixed code for migration from v10 to v11 as per OCA standards.
mgosai Aug 17, 2018
d9bec67
[FIX] Fixed minor missing changes
mgosai Aug 17, 2018
afc6c33
Update __manifest__.py
Aug 20, 2018
9cd20f1
Update DESCRIPTION.rst
max3903 Aug 22, 2018
b3728b4
Update INSTALL.rst
max3903 Aug 22, 2018
b1631a8
[UPD] README.rst
OCA-git-bot Aug 23, 2018
1ef208f
[UPD] README.rst
OCA-git-bot Aug 24, 2018
4111dfa
[UPD] Update auth_user_case_insensitive.pot
oca-travis Dec 12, 2018
f9eca57
Update translation files
oca-transbot Dec 29, 2018
5080fd5
[ADD] icon.png
OCA-git-bot Apr 3, 2019
8b17496
[MIG] auth_user_case_insensitive: Migration to 12.0
May 31, 2019
5b6aa66
[FIX] auth_user_case_insensitive: LDAP error in tests
remytms Oct 1, 2019
214f1a4
[UPD] README.rst
OCA-git-bot Oct 7, 2019
5dfeb0c
Translated using Weblate (Portuguese (Brazil))
Nov 24, 2019
3571f4f
[MIG][13.0] Migrated the module in v13.
Chandresh-SerpentCS Nov 27, 2019
eaf8a80
[UPD] Update auth_user_case_insensitive.pot
oca-travis Feb 3, 2020
f49c21c
Update translation files
oca-transbot Mar 14, 2020
e87bc6f
[MIG] Module migrated in v14.
Chandresh-SerpentCS Feb 10, 2021
a0eb9cf
[UPD] Update auth_user_case_insensitive.pot
oca-travis Mar 3, 2021
ece65d2
[UPD] README.rst
OCA-git-bot Mar 3, 2021
488c4bb
[MIG] auth_user_case_insensitive: Migration to 15.0
Herqs Apr 11, 2022
2dc777d
[UPD] Update auth_user_case_insensitive.pot
Oct 6, 2022
84aca96
[MIG] auth_user_case_insensitive: Migration to 16.0
Feb 17, 2023
8610c26
[UPD] Update auth_user_case_insensitive.pot
Jul 2, 2023
2e44ec4
[UPD] README.rst
OCA-git-bot Jul 2, 2023
4a11d80
Update translation files
weblate Jul 2, 2023
c207d68
Update translation files
weblate Jul 2, 2023
143070b
Translated using Weblate (Spanish)
Ivorra78 Aug 25, 2023
4c6e296
[UPD] README.rst
OCA-git-bot Sep 3, 2023
a91895a
Translated using Weblate (Italian)
mymage Jan 3, 2024
4a827de
[IMP] auth_user_case_insensitive: pre-commit stuff
Jan 29, 2024
8ec115e
[MIG] auth_user_case_insensitive: Migration to 17.0
Jan 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions auth_user_case_insensitive/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
=======================
Case Insensitive Logins
=======================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:ed83d6389739201d4062cd5ecfd9721cac3d2de46b63d9d0e14f7ecd8aa4d96f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
: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/17.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-17-0/server-auth-17-0-auth_user_case_insensitive
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-auth&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module makes user logins case insensitive. It also overwrites the
search method to allow these case insensitive logins to work on a
database that previously had case sensitive logins.

**Table of contents**

.. contents::
:local:

Installation
============

Install this module as you would any other. No further configuration is
required.

Note that upon installation the existing logins will all be converted to
lowercase.

Usage
=====

|Steps to test the module|

.. |Steps to test the module| image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:target: https://runbot.odoo-community.org/runbot/167/11.0

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-auth/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/server-auth/issues/new?body=module:%20auth_user_case_insensitive%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* LasLabs

Contributors
------------

- Dave Lasley <[email protected]>
- Ted Salmon <[email protected]>
- Mayank Gosai <[email protected]>
- Chandresh Thakkar <[email protected]>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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 <https://github.com/OCA/server-auth/tree/17.0/auth_user_case_insensitive>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
7 changes: 7 additions & 0 deletions auth_user_case_insensitive/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 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
from .hooks import pre_init_hook_login_check
from .hooks import post_init_hook_login_convert
18 changes: 18 additions & 0 deletions auth_user_case_insensitive/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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": "17.0.1.0.0",
"category": "Authentication",
"website": "https://github.com/OCA/server-auth",
"author": "LasLabs, Odoo Community Association (OCA)",
"maintainer": "Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["mail"],
"pre_init_hook": "pre_init_hook_login_check",
"post_init_hook": "post_init_hook_login_convert",
}
34 changes: 34 additions & 0 deletions auth_user_case_insensitive/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2017 LasLabs Inc.
# Copyright 2021 Open Source Integrators
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from odoo import _
from odoo.exceptions import ValidationError


def pre_init_hook_login_check(env):
"""This hook will look to see if any conflicting logins exist before
the module is installed
:param env:
Environment.
"""
with env.cr.savepoint():
users = []
env.cr.execute("SELECT login FROM res_users")
for user in env.cr.fetchall():
login = user[0].lower()
if login not in users:
users.append(login)
else:
raise ValidationError(

Check warning on line 23 in auth_user_case_insensitive/hooks.py

View check run for this annotation

Codecov / codecov/patch

auth_user_case_insensitive/hooks.py#L23

Added line #L23 was not covered by tests
_("Conflicting user logins exist for `%s`", login)
)


def post_init_hook_login_convert(env):
"""After the module is installed, set all logins to lowercase
:param env:
Environment.
"""
with env.cr.savepoint():
env.cr.execute("UPDATE res_users SET login=lower(login)")
45 changes: 45 additions & 0 deletions auth_user_case_insensitive/i18n/ar.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * auth_user_case_insensitive
#
# Translators:
# OCA Transbot <[email protected]>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-05-17 21:08+0000\n"
"PO-Revision-Date: 2017-05-17 21:08+0000\n"
"Last-Translator: OCA Transbot <[email protected]>, 2017\n"
"Language-Team: Arabic (https://www.transifex.com/oca/teams/23907/ar/)\n"
"Language: ar\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"

#. module: auth_user_case_insensitive
#. odoo-python
#: code:addons/auth_user_case_insensitive/hooks.py:0
#, python-format
msgid "Conflicting user logins exist for `%s`"
msgstr ""

#. module: auth_user_case_insensitive
#: model:ir.model.fields,field_description:auth_user_case_insensitive.field_res_users__login
msgid "Login"
msgstr ""

#. module: auth_user_case_insensitive
#: model:ir.model.fields,help:auth_user_case_insensitive.field_res_users__login
msgid "Used to log into the system. Case insensitive."
msgstr ""

#. module: auth_user_case_insensitive
#: model:ir.model,name:auth_user_case_insensitive.model_res_users
msgid "User"
msgstr ""

#~ msgid "Users"
#~ msgstr "المستخدمون"
36 changes: 36 additions & 0 deletions auth_user_case_insensitive/i18n/auth_user_case_insensitive.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * auth_user_case_insensitive
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: auth_user_case_insensitive
#. odoo-python
#: code:addons/auth_user_case_insensitive/hooks.py:0
#, python-format
msgid "Conflicting user logins exist for `%s`"
msgstr ""

#. module: auth_user_case_insensitive
#: model:ir.model.fields,field_description:auth_user_case_insensitive.field_res_users__login
msgid "Login"
msgstr ""

#. module: auth_user_case_insensitive
#: model:ir.model.fields,help:auth_user_case_insensitive.field_res_users__login
msgid "Used to log into the system. Case insensitive."
msgstr ""

#. module: auth_user_case_insensitive
#: model:ir.model,name:auth_user_case_insensitive.model_res_users
msgid "User"
msgstr ""
44 changes: 44 additions & 0 deletions auth_user_case_insensitive/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * auth_user_case_insensitive
#
# Translators:
# OCA Transbot <[email protected]>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-08-01 02:43+0000\n"
"PO-Revision-Date: 2017-08-01 02:43+0000\n"
"Last-Translator: OCA Transbot <[email protected]>, 2017\n"
"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: auth_user_case_insensitive
#. odoo-python
#: code:addons/auth_user_case_insensitive/hooks.py:0
#, python-format
msgid "Conflicting user logins exist for `%s`"
msgstr ""

#. module: auth_user_case_insensitive
#: model:ir.model.fields,field_description:auth_user_case_insensitive.field_res_users__login
msgid "Login"
msgstr ""

#. module: auth_user_case_insensitive
#: model:ir.model.fields,help:auth_user_case_insensitive.field_res_users__login
msgid "Used to log into the system. Case insensitive."
msgstr ""

#. module: auth_user_case_insensitive
#: model:ir.model,name:auth_user_case_insensitive.model_res_users
msgid "User"
msgstr ""

#~ msgid "Users"
#~ msgstr "Usuaris"
44 changes: 44 additions & 0 deletions auth_user_case_insensitive/i18n/da.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * auth_user_case_insensitive
#
# Translators:
# OCA Transbot <[email protected]>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-05-17 21:08+0000\n"
"PO-Revision-Date: 2017-05-17 21:08+0000\n"
"Last-Translator: OCA Transbot <[email protected]>, 2017\n"
"Language-Team: Danish (https://www.transifex.com/oca/teams/23907/da/)\n"
"Language: da\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: auth_user_case_insensitive
#. odoo-python
#: code:addons/auth_user_case_insensitive/hooks.py:0
#, python-format
msgid "Conflicting user logins exist for `%s`"
msgstr ""

#. module: auth_user_case_insensitive
#: model:ir.model.fields,field_description:auth_user_case_insensitive.field_res_users__login
msgid "Login"
msgstr ""

#. module: auth_user_case_insensitive
#: model:ir.model.fields,help:auth_user_case_insensitive.field_res_users__login
msgid "Used to log into the system. Case insensitive."
msgstr ""

#. module: auth_user_case_insensitive
#: model:ir.model,name:auth_user_case_insensitive.model_res_users
msgid "User"
msgstr ""

#~ msgid "Users"
#~ msgstr "Brugere"
44 changes: 44 additions & 0 deletions auth_user_case_insensitive/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * auth_user_case_insensitive
#
# Translators:
# OCA Transbot <[email protected]>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-05-17 21:08+0000\n"
"PO-Revision-Date: 2017-05-17 21:08+0000\n"
"Last-Translator: OCA Transbot <[email protected]>, 2017\n"
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: auth_user_case_insensitive
#. odoo-python
#: code:addons/auth_user_case_insensitive/hooks.py:0
#, python-format
msgid "Conflicting user logins exist for `%s`"
msgstr ""

#. module: auth_user_case_insensitive
#: model:ir.model.fields,field_description:auth_user_case_insensitive.field_res_users__login
msgid "Login"
msgstr ""

#. module: auth_user_case_insensitive
#: model:ir.model.fields,help:auth_user_case_insensitive.field_res_users__login
msgid "Used to log into the system. Case insensitive."
msgstr ""

#. module: auth_user_case_insensitive
#: model:ir.model,name:auth_user_case_insensitive.model_res_users
msgid "User"
msgstr ""

#~ msgid "Users"
#~ msgstr "Benutzer"
Loading
Loading