[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) <tbe@odoo.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user