From 5773d310e912dfe0657fbc134007167daeda47f2 Mon Sep 17 00:00:00 2001 From: Thibault Delavallee Date: Tue, 12 Mar 2013 15:22:57 +0100 Subject: [PATCH] [FIX] mail: notification: do not send a notification email to partners having the same email address than the author, because of loops it may cause. bzr revid: tde@openerp.com-20130312142257-sbtv2f3u9lobj6w5 --- addons/mail/mail_followers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/mail/mail_followers.py b/addons/mail/mail_followers.py index ecdd39874e3..5d2a8966bb8 100644 --- a/addons/mail/mail_followers.py +++ b/addons/mail/mail_followers.py @@ -93,6 +93,9 @@ class mail_notification(osv.Model): # Do not send to partners without email address defined if not partner.email: continue + # Do not send to partners having same email address than the author (can cause loops or bounce effect due to messy database) + if message.author_id and message.author_id.email == partner.email: + continue # Partner does not want to receive any emails or is opt-out if partner.notification_email_send == 'none': continue