From 7ac7c9776234ecb3e6ee78a441bb812c5a4086ed Mon Sep 17 00:00:00 2001 From: Toufik Ben Jaa Date: Wed, 13 Mar 2019 12:46:21 +0000 Subject: [PATCH] [FIX] portal: Portal User creation login check - When creating a user from the "Grant Portal Access" wizard, the code checks for duplicate users. It does so by checking if there is a user with the same login as the one we want to create. The check is case sensitive which could lead to issues. For example a mistyped email (with a uppercase somewhere) could fail the duplicate user check. Since emails are not case sensitive, we want the check to be case insensitive too. OPW-1932918 closes odoo/odoo#31818 Signed-off-by: Toufik Benjaa (tbe) --- addons/portal/wizard/portal_wizard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/portal/wizard/portal_wizard.py b/addons/portal/wizard/portal_wizard.py index 50c623a19e2..4818259a64d 100644 --- a/addons/portal/wizard/portal_wizard.py +++ b/addons/portal/wizard/portal_wizard.py @@ -93,7 +93,7 @@ class PortalWizardUser(models.TransientModel): partners_error_empty |= wizard_user.partner_id elif email in emails: partners_error_emails |= wizard_user.partner_id - user = self.env['res.users'].sudo().with_context(active_test=False).search([('login', '=', email)]) + user = self.env['res.users'].sudo().with_context(active_test=False).search([('login', '=ilike', email)]) if user: partners_error_user |= wizard_user.partner_id emails.append(email)