From 854671b9300e0010ed05ed87a1f147f6ebb2e93e Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Fri, 17 May 2013 17:59:33 +0200 Subject: [PATCH] [FIX] portal managment: wizard refresh and write email bzr revid: chm@openerp.com-20130517155933-e2tc2u9ns9m9jdh7 --- addons/portal/wizard/portal_wizard.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/portal/wizard/portal_wizard.py b/addons/portal/wizard/portal_wizard.py index 9cb5e6a4f85..b88d0edcec0 100644 --- a/addons/portal/wizard/portal_wizard.py +++ b/addons/portal/wizard/portal_wizard.py @@ -167,7 +167,9 @@ class wizard_user(osv.osv_memory): user.write({'active': True, 'groups_id': [(4, portal.id)]}) # prepare for the signup process user.partner_id.signup_prepare() - wizard_user = self.browse(cr, SUPERUSER_ID, wizard_user.id, context) + if wizard_user.partner_id.email != wizard_user.email: + wizard_user.partner_id.write({'email': wizard_user.email}) + wizard_user.refresh() self._send_email(cr, uid, wizard_user, context) else: # remove the user (if it exists) from the portal group @@ -196,8 +198,6 @@ class wizard_user(osv.osv_memory): """ res_users = self.pool.get('res.users') create_context = dict(context or {}, noshortcut=True) # to prevent shortcut creation - if wizard_user.partner_id.email != wizard_user.email: - wizard_user.partner_id.write({'email': wizard_user.email}) values = { 'email': extract_email(wizard_user.email), 'login': extract_email(wizard_user.email),