From bf67507fdd2d17d363dcb4cbe0ca4c2c2994f19b Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 22 May 2013 16:30:17 +0200 Subject: [PATCH] [FIX] portal: avoid errors during portal access management if users already exists (and thus will not cause problems) This allows more complex cases like having a login that is different from the email of the related partners, but the same as the email of another user bzr revid: odo@openerp.com-20130522143017-pr30b3g6j8ht0ma6 --- addons/portal/wizard/portal_wizard.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/portal/wizard/portal_wizard.py b/addons/portal/wizard/portal_wizard.py index 2c72c6847dd..e379adc1c9f 100644 --- a/addons/portal/wizard/portal_wizard.py +++ b/addons/portal/wizard/portal_wizard.py @@ -130,13 +130,13 @@ class wizard_user(osv.osv_memory): error_user = [] ctx = dict(context or {}, active_test=False) for wizard_user in self.browse(cr, SUPERUSER_ID, ids, context): - if wizard_user.in_portal: + if wizard_user.in_portal and not self._retrieve_user(cr, uid, wizard_user, context): email = extract_email(wizard_user.email) if not email: error_empty.append(wizard_user.partner_id) elif email in emails and email not in error_emails: error_emails.append(wizard_user.partner_id) - user = res_users.search(cr, SUPERUSER_ID, [('partner_id', '!=', wizard_user.partner_id.id), ('login', '=', email)], context=ctx) + user = res_users.search(cr, SUPERUSER_ID, [('login', '=', email)], context=ctx) if user: error_user.append(wizard_user.partner_id) emails.append(email)