From 4ea3e318165ece22797d79309b13ae80dc6be6d1 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 4 Nov 2020 15:02:17 +0000 Subject: [PATCH] [FIX] mail: Sending a sms on an opportunity without customer Steps to reproduce the bug: - Create an opportunity without a customer but with a phone number - Send a sms - Refesh the page Bug: A traceback was raised because an entry is created in mail_message_res_partner_needaction_rel with partner_id = False Due to https://github.com/odoo/odoo/blob/14.0/addons/sms/models/mail_thread.py#L327 A mail.notification is created from a sms even if there is no partner set on the sms opw:2372201 closes odoo/odoo#61425 X-original-commit: 651da2fe8694ed0003a9dd0801c71f2ef26cedb9 Signed-off-by: Simon Goffin (sig) --- addons/mail/models/mail_notification.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/models/mail_notification.py b/addons/mail/models/mail_notification.py index 3a67e565a7a..44f03184f0d 100644 --- a/addons/mail/models/mail_notification.py +++ b/addons/mail/models/mail_notification.py @@ -100,5 +100,5 @@ class MailNotification(models.Model): 'notification_type': notif.notification_type, 'notification_status': notif.notification_status, 'failure_type': notif.failure_type, - 'res_partner_id': [notif.res_partner_id.id, notif.res_partner_id.display_name], + 'res_partner_id': [notif.res_partner_id.id, notif.res_partner_id.display_name] if notif.res_partner_id else False, } for notif in self]