From a69366ef0320a988460e81f5c1f384f7cabec79e Mon Sep 17 00:00:00 2001 From: std-odoo Date: Tue, 22 Feb 2022 10:29:05 +0000 Subject: [PATCH] [FIX] mail_plugin: fix traceback when the partner has been removed Bug === 1. Open an email in Outlook, and create the contact 2. Go to Odoo and remove the partner 3. Without refreshing the browser tab, click on the "reload" icon of the addin. A traceback will be raised on the Odoo side Task-2601837 X-original-commit: bb2e5ce9cf149a5cfd68cf908184c823f882d97d Part-of: odoo/odoo#89848 --- addons/mail_plugin/controllers/mail_plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail_plugin/controllers/mail_plugin.py b/addons/mail_plugin/controllers/mail_plugin.py index 666105ec958..5ca600a954c 100644 --- a/addons/mail_plugin/controllers/mail_plugin.py +++ b/addons/mail_plugin/controllers/mail_plugin.py @@ -144,7 +144,7 @@ class MailPluginController(http.Controller): return {'error': _('You need to specify at least the partner_id or the name and the email')} if partner_id: - partner = request.env['res.partner'].browse(partner_id) + partner = request.env['res.partner'].browse(partner_id).exists() return self._get_contact_data(partner) normalized_email = tools.email_normalize(email)