-
-
Notifications
You must be signed in to change notification settings - Fork 543
[18.0][MIG] auth_user_case_insensitive: Migration to 18.0 #712
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
Closed
moncefarajdal
wants to merge
31
commits into
OCA:18.0
from
moncefarajdal:18.0-mig-auth_user_case_insensitive
Closed
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
e6cd025
[IMP] auth_user_case_insensitive: Update module name
74a83b8
[IMP] auth_user_case_insensitive: Drop `search()` override in favor o…
0855b7a
Note that existing logins are converted to lowercase
dreispt b6f55c9
[FIX/IMP] Fixed code for migration from v10 to v11 as per OCA standards.
mgosai fe9c1b1
[FIX] Fixed minor missing changes
mgosai 83b73da
Update __manifest__.py
3a5c7d8
[MIG] auth_user_case_insensitive: Migration to 12.0
16ea7ab
[FIX] auth_user_case_insensitive: LDAP error in tests
remytms 92b387e
Translated using Weblate (Portuguese (Brazil))
aed43df
[MIG][13.0] Migrated the module in v13.
Chandresh-SerpentCS 1d6fa95
[MIG] Module migrated in v14.
Chandresh-SerpentCS b5f652e
[MIG] auth_user_case_insensitive: Migration to 15.0
Herqs 0184085
[MIG] auth_user_case_insensitive: Migration to 16.0
5f0b712
Translated using Weblate (Spanish)
Ivorra78 20d9966
Translated using Weblate (Italian)
mymage 5a85ef9
[IMP] auth_user_case_insensitive: pre-commit stuff
503146e
[MIG] auth_user_case_insensitive: Migration to 17.0
798cef8
[UPD] Update auth_user_case_insensitive.pot
4fff9b3
[BOT] post-merge updates
OCA-git-bot 4c697fc
Update translation files
weblate a460a03
[MIG] auth_user_case_insensitive: Migration to 18.0
de29c96
[MIG] auth_user_case_insensitive: Migration to 18.0
2110c74
[MIG] auth_user_case_insensitive: Migration to 18.0
aa17e2d
[MIG] auth_user_case_insensitive: Migration to 18.0
11c06f6
[MIG] auth_user_case_insensitive: Migration to 18.0
4eca4de
[MIG] auth_user_case_insensitive: Migration to 18.0
166acff
[MIG] auth_user_case_insensitive: Migration to 18.0
99c71f6
[MIG] auth_user_case_insensitive: Migration to 18.0
f353bc2
[MIG] auth_user_case_insensitive: Migration to 18.0
eb18c84
[IMP] auth_user_case_insensitive: pre-commit auto fixes
963ff6a
Add name in contributors README.rst
moncefarajdal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| ======================= | ||
| Case Insensitive Logins | ||
| ======================= | ||
|
|
||
| .. | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! This file is generated by oca-gen-addon-readme !! | ||
| !! changes will be overwritten. !! | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! source digest: sha256:191e82e2a345b4dab163f77be2535319c23f64fb605fdba6bb24f8b4d0948c4e | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
|
||
| .. |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/18.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-18-0/server-auth-18-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=18.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:%2018.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 <dave@laslabs.com> | ||
| - Ted Salmon <tsalmon@laslabs.com> | ||
| - Mayank Gosai <mgosai@opensourceintegrators.com> | ||
| - Chandresh Thakkar <chandresh.thakkar.serpentcs@gmail.com> | ||
| - Moncef Arajdal <moncefarajdal@gmail.com> | ||
|
|
||
| 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/18.0/auth_user_case_insensitive>`_ project on GitHub. | ||
|
|
||
| You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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": "18.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", | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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( | ||
| _("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)") | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 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
36
auth_user_case_insensitive/i18n/auth_user_case_insensitive.pot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 17.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 "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 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" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible small performance improvement according to the migration docs