[FIX] mail.thread: message_redirect_action should not crash when the message has been deleted

bzr revid: odo@openerp.com-20131028160100-yhebao3adbzz00cn
This commit is contained in:
Olivier Dony 2013-10-28 17:01:00 +01:00
parent 5db5d655d6
commit d1d35b3f57
1 changed files with 2 additions and 1 deletions

View File

@ -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: