Skip to content

Commit

Permalink
[FIX] mass_mailing: wrong copy-paste of statistics computation code
Browse files Browse the repository at this point in the history
Mixes the mass_mailing_id and mass_mailing_campaign_id
between the two models. Introduced by 9fc4ad9, PR odoo#472
  • Loading branch information
odony committed Jul 4, 2014
1 parent f3880a8 commit d32fc5c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions addons/mass_mailing/mass_mailing.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _get_statistics(self, cr, uid, ids, name, arg, context=None):
})
cr.execute("""
SELECT
mass_mailing_id,
mass_mailing_campaign_id,
COUNT(id) AS sent,
COUNT(CASE WHEN bounced is null THEN 1 ELSE null END) AS delivered,
COUNT(CASE WHEN opened is not null THEN 1 ELSE null END) AS opened,
Expand All @@ -55,9 +55,9 @@ def _get_statistics(self, cr, uid, ids, name, arg, context=None):
FROM
mail_mail_statistics
WHERE
mass_mailing_id IN %s
mass_mailing_campaign_id IN %s
GROUP BY
mass_mailing_id
mass_mailing_campaign_id
""", (tuple(ids), ))
for (campaign_id, sent, delivered, opened, replied, bounced) in cr.fetchall():
results[campaign_id] = {
Expand Down Expand Up @@ -239,8 +239,8 @@ def _get_statistics(self, cr, uid, ids, name, arg, context=None):
GROUP BY
mass_mailing_id
""", (tuple(ids), ))
for (campaign_id, sent, delivered, opened, replied, bounced) in cr.fetchall():
results[campaign_id] = {
for (mass_mailing_id, sent, delivered, opened, replied, bounced) in cr.fetchall():
results[mass_mailing_id] = {
'sent': sent,
# delivered: shouldn't be: all mails - (failed + bounced) ?
'delivered': delivered,
Expand Down

0 comments on commit d32fc5c

Please sign in to comment.