From 68a9a4ce54947758afe9d7f077f6c3e5cc6a7e45 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Tue, 11 Apr 2017 10:48:25 +0200 Subject: [PATCH] [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. --- addons/portal/wizard/portal_wizard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/portal/wizard/portal_wizard.py b/addons/portal/wizard/portal_wizard.py index 051d4bee319..6161cc1de20 100644 --- a/addons/portal/wizard/portal_wizard.py +++ b/addons/portal/wizard/portal_wizard.py @@ -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