From d1d35b3f573a2f0407abed51b1d8f2b689b745d7 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Mon, 28 Oct 2013 17:01:00 +0100 Subject: [PATCH] [FIX] mail.thread: message_redirect_action should not crash when the message has been deleted bzr revid: odo@openerp.com-20131028160100-yhebao3adbzz00cn --- addons/mail/mail_thread.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 9692b94f159..9ed63ae14fa 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -577,7 +577,8 @@ class mail_thread(osv.AbstractModel): return action if msg_id and not (model and res_id): msg = self.pool.get('mail.message').browse(cr, uid, msg_id, context=context) - model, res_id = msg.model, msg.res_id + if msg.exists(): + model, res_id = msg.model, msg.res_id # if model + res_id found: try to redirect to the document or fallback on the Inbox if model and res_id: