From 7c5275b6a11157415da0d7e006b7447b1e7e282e Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 19 May 2016 10:47:56 +0200 Subject: [PATCH] [FIX] mail: to prevent infinite loop Introduced by fac04424caa095511b0f809b351fc2af0a5942cc --- addons/mail/mail_message.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index b66f41454cd..7e09fa4eb81 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -884,7 +884,8 @@ class mail_message(osv.Model): # the parent message -> add a read notification for the parent if message.parent_id: parent_id = message.parent_id - while parent_id: + check = set() + while parent_id and parent_id not in check: # all notified_partner_ids of the mail.message have to be notified for the parented messages partners_to_parent_notify = set(message.notified_partner_ids).difference(parent_id.notified_partner_ids) for partner in partners_to_parent_notify: @@ -893,4 +894,5 @@ class mail_message(osv.Model): 'partner_id': partner.id, 'is_read': True, }, context=context) + check.add(parent_id) parent_id = parent_id.parent_id