summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2013-05-22 16:30:17 +0200
committerOlivier Dony <odo@openerp.com>2013-05-22 16:30:17 +0200
commitbf67507fdd2d17d363dcb4cbe0ca4c2c2994f19b (patch)
tree259a084877a409302d1aa6b591a97c14c3b9cc1f /addons
parente6a8f9aac010109cde4e8f6fa3696745fc472b54 (diff)
[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
Diffstat (limited to 'addons')
-rw-r--r--addons/portal/wizard/portal_wizard.py4
1 files 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)