From 700bbfcce1ea4ef9759b1247bccfa712412e5a5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 25 Feb 2014 10:06:37 +0100 Subject: [PATCH] [FIX] mail_thread: when reading subscription data, add a protection against not planned subtype data (coming from error in subtype relationship table, or for undisplayed subtypes, old subtypes, ...). bzr revid: tde@openerp.com-20140225090637-mnztroc05nk7l2sl --- addons/mail/mail_thread.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 1378aabd3ee..33cc5481108 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -199,7 +199,7 @@ class mail_thread(osv.AbstractModel): ], context=context) for fol in fol_obj.browse(cr, uid, fol_ids, context=context): thread_subtype_dict = res[fol.res_id]['message_subtype_data'] - for subtype in fol.subtype_ids: + for subtype in [st for st in fol.subtype_ids if st.name in thread_subtype_dict]: thread_subtype_dict[subtype.name]['followed'] = True res[fol.res_id]['message_subtype_data'] = thread_subtype_dict