Merge lp:~openerp-dev/openobject-addons/7.0-opw-605463-fka into lp:openobject-addons/7.0

Proposed by Foram Katharotiya (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-605463-fka
Merge into: lp:openobject-addons/7.0
Diff against target: 18 lines (+4/-1)
1 file modified
mail/mail_mail.py (+4/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-605463-fka
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+212094@code.launchpad.net

Description of the change

Hello sir,

I have improve the code for only send mail once when two or more followers have same email address.

Regards,
Foram

To post a comment you must log in.

Unmerged revisions

9920. By Foram Katharotiya (OpenERP)

[IMP] only send mail once when two follower have same email address

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mail/mail_mail.py'
2--- mail/mail_mail.py 2013-12-20 14:46:52 +0000
3+++ mail/mail_mail.py 2014-03-21 07:04:38 +0000
4@@ -281,11 +281,14 @@
5 attachments.append((attach.datas_fname, base64.b64decode(attach.datas)))
6 # specific behavior to customize the send email for notified partners
7 email_list = []
8+ partner_email = []
9 if recipient_ids:
10 partner_obj = self.pool.get('res.partner')
11 existing_recipient_ids = partner_obj.exists(cr, SUPERUSER_ID, recipient_ids, context=context)
12 for partner in partner_obj.browse(cr, SUPERUSER_ID, existing_recipient_ids, context=context):
13- email_list.append(self.send_get_email_dict(cr, uid, mail, partner=partner, context=context))
14+ if partner.email not in partner_email:
15+ partner_email.append(partner.email)
16+ email_list.append(self.send_get_email_dict(cr, uid, mail, partner=partner, context=context))
17 else:
18 email_list.append(self.send_get_email_dict(cr, uid, mail, context=context))
19