[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
This commit is contained in:
Thibault Delavallee
2013-03-12 15:22:57 +01:00
parent 74a1ea6617
commit 5773d310e9
+3
View File
@@ -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