[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
This commit is contained in:
std-odoo
2022-04-27 15:31:48 +02:00
parent ca5ddbbcd7
commit a69366ef03
@@ -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)