[FIX] portal: fix regression of API migration in the portal wizard

Before the migration, send_mail() used to be called with an untainted
context but after the API migration it inherited the altered context
with active_test=False which caused subsequent calls to
ir.mail_server#connect() to fetch inactive records.
This commit is contained in:
Fabien Meghazi
2017-04-11 12:28:34 +02:00
parent 3a88f7826b
commit 68a9a4ce54
+1 -1
View File
@@ -149,7 +149,7 @@ class PortalWizardUser(models.TransientModel):
wizard_user.user_id.write({'active': True, 'groups_id': [(4, group_portal.id)]})
# prepare for the signup process
wizard_user.user_id.partner_id.signup_prepare()
wizard_user._send_email()
wizard_user.with_context(active_test=True)._send_email()
wizard_user.refresh()
else:
# remove the user (if it exists) from the portal group