Skip to content

Commit f9c9c44

Browse files
committed
Merge PR #860 into 19.0
Signed-off-by etobella
2 parents ac5a825 + c32c7b5 commit f9c9c44

40 files changed

+1819
-0
lines changed
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
.. image:: https://odoo-community.org/readme-banner-image
2+
:target: https://odoo-community.org/get-involved?utm_source=readme
3+
:alt: Odoo Community Association
4+
5+
=======================
6+
Case Insensitive Logins
7+
=======================
8+
9+
..
10+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11+
!! This file is generated by oca-gen-addon-readme !!
12+
!! changes will be overwritten. !!
13+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14+
!! source digest: sha256:4ee1eddab2396f1f3a38f0496d2cc7e25b56106227a5f16fcf873ace73e868e7
15+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16+
17+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
18+
:target: https://odoo-community.org/page/development-status
19+
:alt: Beta
20+
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
21+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
22+
:alt: License: AGPL-3
23+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--auth-lightgray.png?logo=github
24+
:target: https://github.com/OCA/server-auth/tree/19.0/auth_user_case_insensitive
25+
:alt: OCA/server-auth
26+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
27+
:target: https://translation.odoo-community.org/projects/server-auth-19-0/server-auth-19-0-auth_user_case_insensitive
28+
:alt: Translate me on Weblate
29+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-auth&target_branch=19.0
31+
:alt: Try me on Runboat
32+
33+
|badge1| |badge2| |badge3| |badge4| |badge5|
34+
35+
This module makes user logins case insensitive. It also overwrites the
36+
search method to allow these case insensitive logins to work on a
37+
database that previously had case sensitive logins.
38+
39+
**Table of contents**
40+
41+
.. contents::
42+
:local:
43+
44+
Installation
45+
============
46+
47+
Install this module as you would any other. No further configuration is
48+
required.
49+
50+
Note that upon installation the existing logins will all be converted to
51+
lowercase.
52+
53+
Usage
54+
=====
55+
56+
|Steps to test the module|
57+
58+
.. |Steps to test the module| image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
59+
:target: https://runbot.odoo-community.org/runbot/167/11.0
60+
61+
Bug Tracker
62+
===========
63+
64+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-auth/issues>`_.
65+
In case of trouble, please check there if your issue has already been reported.
66+
If you spotted it first, help us to smash it by providing a detailed and welcomed
67+
`feedback <https://github.com/OCA/server-auth/issues/new?body=module:%20auth_user_case_insensitive%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
68+
69+
Do not contact contributors directly about support or help with technical issues.
70+
71+
Credits
72+
=======
73+
74+
Authors
75+
-------
76+
77+
* LasLabs
78+
79+
Contributors
80+
------------
81+
82+
- Dave Lasley <dave@laslabs.com>
83+
- Ted Salmon <tsalmon@laslabs.com>
84+
- Mayank Gosai <mgosai@opensourceintegrators.com>
85+
- Chandresh Thakkar <chandresh.thakkar.serpentcs@gmail.com>
86+
87+
Maintainers
88+
-----------
89+
90+
This module is maintained by the OCA.
91+
92+
.. image:: https://odoo-community.org/logo.png
93+
:alt: Odoo Community Association
94+
:target: https://odoo-community.org
95+
96+
OCA, or the Odoo Community Association, is a nonprofit organization whose
97+
mission is to support the collaborative development of Odoo features and
98+
promote its widespread use.
99+
100+
This module is part of the `OCA/server-auth <https://github.com/OCA/server-auth/tree/19.0/auth_user_case_insensitive>`_ project on GitHub.
101+
102+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright 2015-2017 LasLabs Inc.
2+
# Copyright 2021 Open Source Integrators
3+
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
4+
5+
from . import models
6+
from .hooks import pre_init_hook_login_check
7+
from .hooks import post_init_hook_login_convert
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright 2015-2017 LasLabs Inc.
2+
# Copyright 2021 Open Source Integrators
3+
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
4+
{
5+
"name": "Case Insensitive Logins",
6+
"summary": "Makes the user login field case insensitive",
7+
"version": "19.0.1.0.0",
8+
"category": "Authentication",
9+
"website": "https://github.com/OCA/server-auth",
10+
"author": "LasLabs, Odoo Community Association (OCA)",
11+
"maintainer": "Odoo Community Association (OCA)",
12+
"license": "AGPL-3",
13+
"application": False,
14+
"installable": True,
15+
"depends": ["mail"],
16+
"pre_init_hook": "pre_init_hook_login_check",
17+
"post_init_hook": "post_init_hook_login_convert",
18+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright 2017 LasLabs Inc.
2+
# Copyright 2021 Open Source Integrators
3+
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
4+
5+
from odoo.exceptions import ValidationError
6+
7+
8+
def pre_init_hook_login_check(env):
9+
"""This hook will look to see if any conflicting logins exist before
10+
the module is installed
11+
:param env:
12+
Environment.
13+
"""
14+
with env.cr.savepoint():
15+
users = []
16+
env.cr.execute("SELECT login FROM res_users")
17+
for user in env.cr.fetchall():
18+
login = user[0].lower()
19+
if login not in users:
20+
users.append(login)
21+
else:
22+
raise ValidationError(
23+
env._("Conflicting user logins exist for `%s`", login)
24+
)
25+
26+
27+
def post_init_hook_login_convert(env):
28+
"""After the module is installed, set all logins to lowercase
29+
:param env:
30+
Environment.
31+
"""
32+
with env.cr.savepoint():
33+
env.cr.execute("UPDATE res_users SET login=lower(login)")
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * auth_user_case_insensitive
4+
#
5+
# Translators:
6+
# OCA Transbot <transbot@odoo-community.org>, 2017
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: Odoo Server 10.0\n"
10+
"Report-Msgid-Bugs-To: \n"
11+
"POT-Creation-Date: 2017-05-17 21:08+0000\n"
12+
"PO-Revision-Date: 2017-05-17 21:08+0000\n"
13+
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
14+
"Language-Team: Arabic (https://www.transifex.com/oca/teams/23907/ar/)\n"
15+
"Language: ar\n"
16+
"MIME-Version: 1.0\n"
17+
"Content-Type: text/plain; charset=UTF-8\n"
18+
"Content-Transfer-Encoding: \n"
19+
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
20+
"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
21+
22+
#. module: auth_user_case_insensitive
23+
#. odoo-python
24+
#: code:addons/auth_user_case_insensitive/hooks.py:0
25+
#, python-format
26+
msgid "Conflicting user logins exist for `%s`"
27+
msgstr ""
28+
29+
#. module: auth_user_case_insensitive
30+
#: model:ir.model.fields,field_description:auth_user_case_insensitive.field_res_users__login
31+
msgid "Login"
32+
msgstr ""
33+
34+
#. module: auth_user_case_insensitive
35+
#: model:ir.model.fields,help:auth_user_case_insensitive.field_res_users__login
36+
msgid "Used to log into the system. Case insensitive."
37+
msgstr ""
38+
39+
#. module: auth_user_case_insensitive
40+
#: model:ir.model,name:auth_user_case_insensitive.model_res_users
41+
msgid "User"
42+
msgstr ""
43+
44+
#~ msgid "Users"
45+
#~ msgstr "المستخدمون"
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * auth_user_case_insensitive
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 18.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"Last-Translator: \n"
10+
"Language-Team: \n"
11+
"MIME-Version: 1.0\n"
12+
"Content-Type: text/plain; charset=UTF-8\n"
13+
"Content-Transfer-Encoding: \n"
14+
"Plural-Forms: \n"
15+
16+
#. module: auth_user_case_insensitive
17+
#. odoo-python
18+
#: code:addons/auth_user_case_insensitive/hooks.py:0
19+
msgid "Conflicting user logins exist for `%s`"
20+
msgstr ""
21+
22+
#. module: auth_user_case_insensitive
23+
#: model:ir.model,name:auth_user_case_insensitive.model_res_users
24+
msgid "User"
25+
msgstr ""
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * auth_user_case_insensitive
4+
#
5+
# Translators:
6+
# OCA Transbot <transbot@odoo-community.org>, 2017
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: Odoo Server 10.0\n"
10+
"Report-Msgid-Bugs-To: \n"
11+
"POT-Creation-Date: 2017-08-01 02:43+0000\n"
12+
"PO-Revision-Date: 2017-08-01 02:43+0000\n"
13+
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
14+
"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n"
15+
"Language: ca\n"
16+
"MIME-Version: 1.0\n"
17+
"Content-Type: text/plain; charset=UTF-8\n"
18+
"Content-Transfer-Encoding: \n"
19+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
20+
21+
#. module: auth_user_case_insensitive
22+
#. odoo-python
23+
#: code:addons/auth_user_case_insensitive/hooks.py:0
24+
#, python-format
25+
msgid "Conflicting user logins exist for `%s`"
26+
msgstr ""
27+
28+
#. module: auth_user_case_insensitive
29+
#: model:ir.model.fields,field_description:auth_user_case_insensitive.field_res_users__login
30+
msgid "Login"
31+
msgstr ""
32+
33+
#. module: auth_user_case_insensitive
34+
#: model:ir.model.fields,help:auth_user_case_insensitive.field_res_users__login
35+
msgid "Used to log into the system. Case insensitive."
36+
msgstr ""
37+
38+
#. module: auth_user_case_insensitive
39+
#: model:ir.model,name:auth_user_case_insensitive.model_res_users
40+
msgid "User"
41+
msgstr ""
42+
43+
#~ msgid "Users"
44+
#~ msgstr "Usuaris"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * auth_user_case_insensitive
4+
#
5+
# Translators:
6+
# OCA Transbot <transbot@odoo-community.org>, 2017
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: Odoo Server 10.0\n"
10+
"Report-Msgid-Bugs-To: \n"
11+
"POT-Creation-Date: 2017-05-17 21:08+0000\n"
12+
"PO-Revision-Date: 2017-05-17 21:08+0000\n"
13+
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
14+
"Language-Team: Danish (https://www.transifex.com/oca/teams/23907/da/)\n"
15+
"Language: da\n"
16+
"MIME-Version: 1.0\n"
17+
"Content-Type: text/plain; charset=UTF-8\n"
18+
"Content-Transfer-Encoding: \n"
19+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
20+
21+
#. module: auth_user_case_insensitive
22+
#. odoo-python
23+
#: code:addons/auth_user_case_insensitive/hooks.py:0
24+
#, python-format
25+
msgid "Conflicting user logins exist for `%s`"
26+
msgstr ""
27+
28+
#. module: auth_user_case_insensitive
29+
#: model:ir.model.fields,field_description:auth_user_case_insensitive.field_res_users__login
30+
msgid "Login"
31+
msgstr ""
32+
33+
#. module: auth_user_case_insensitive
34+
#: model:ir.model.fields,help:auth_user_case_insensitive.field_res_users__login
35+
msgid "Used to log into the system. Case insensitive."
36+
msgstr ""
37+
38+
#. module: auth_user_case_insensitive
39+
#: model:ir.model,name:auth_user_case_insensitive.model_res_users
40+
msgid "User"
41+
msgstr ""
42+
43+
#~ msgid "Users"
44+
#~ msgstr "Brugere"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * auth_user_case_insensitive
4+
#
5+
# Translators:
6+
# OCA Transbot <transbot@odoo-community.org>, 2017
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: Odoo Server 10.0\n"
10+
"Report-Msgid-Bugs-To: \n"
11+
"POT-Creation-Date: 2017-05-17 21:08+0000\n"
12+
"PO-Revision-Date: 2017-05-17 21:08+0000\n"
13+
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
14+
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n"
15+
"Language: de\n"
16+
"MIME-Version: 1.0\n"
17+
"Content-Type: text/plain; charset=UTF-8\n"
18+
"Content-Transfer-Encoding: \n"
19+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
20+
21+
#. module: auth_user_case_insensitive
22+
#. odoo-python
23+
#: code:addons/auth_user_case_insensitive/hooks.py:0
24+
#, python-format
25+
msgid "Conflicting user logins exist for `%s`"
26+
msgstr ""
27+
28+
#. module: auth_user_case_insensitive
29+
#: model:ir.model.fields,field_description:auth_user_case_insensitive.field_res_users__login
30+
msgid "Login"
31+
msgstr ""
32+
33+
#. module: auth_user_case_insensitive
34+
#: model:ir.model.fields,help:auth_user_case_insensitive.field_res_users__login
35+
msgid "Used to log into the system. Case insensitive."
36+
msgstr ""
37+
38+
#. module: auth_user_case_insensitive
39+
#: model:ir.model,name:auth_user_case_insensitive.model_res_users
40+
msgid "User"
41+
msgstr ""
42+
43+
#~ msgid "Users"
44+
#~ msgstr "Benutzer"

0 commit comments

Comments
 (0)