summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2016-10-25 10:31:59 +0200
committerNicolas Martinelli <nim@odoo.com>2016-10-25 10:31:59 +0200
commit135a5daeb83c3deac0a0be968d5e7cb24cfa30de (patch)
tree6818236e16229bff2084de215dc7f43aa474bffc /addons
parent34d3754ae0f09e078190170ab84da202096ccfee (diff)
[FIX] website_mail_channel: message count
The message count on a mailing list looks incorrect since notifications are counted but not displayed. opw-691948
Diffstat (limited to 'addons')
-rw-r--r--addons/website_mail_channel/controllers/main.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/website_mail_channel/controllers/main.py b/addons/website_mail_channel/controllers/main.py
index fc03002f5b8..c78964d7743 100644
--- a/addons/website_mail_channel/controllers/main.py
+++ b/addons/website_mail_channel/controllers/main.py
@@ -15,7 +15,8 @@ class MailGroup(http.Controller):
def _get_archives(self, group_id):
MailMessage = request.env['mail.message']
groups = MailMessage._read_group_raw(
- [('model', '=', 'mail.channel'), ('res_id', '=', group_id)], ['subject', 'date'],
+ [('model', '=', 'mail.channel'), ('res_id', '=', group_id), ('message_type', '!=', 'notification')],
+ ['subject', 'date'],
groupby=["date"], orderby="date desc")
for group in groups:
(r, label) = group['date']
@@ -41,7 +42,7 @@ class MailGroup(http.Controller):
# compute statistics
month_date = datetime.today() - relativedelta.relativedelta(months=1)
messages = request.env['mail.message'].read_group(
- [('model', '=', 'mail.channel'), ('date', '>=', fields.Datetime.to_string(month_date))],
+ [('model', '=', 'mail.channel'), ('date', '>=', fields.Datetime.to_string(month_date)), ('message_type', '!=', 'notification')],
[], ['res_id'])
message_data = dict((message['res_id'], message['res_id_count']) for message in messages)