Skip to content

Commit

Permalink
[FIX] odoo: count should be distinct in read_group for filters like '…
Browse files Browse the repository at this point in the history
…unread messages' or 'activity' in both view kanban or list;

before this commit
	- apply filters like 'unread messages', 'late activity' etc with any group by then result is total number of unread messages or activity
after this commit
	- apply filters like 'unread messages', 'activity' with any group by then result should display total no of records which have unread messages or activity.
  • Loading branch information
dbh-odoo committed Mar 9, 2018
1 parent b17ba35 commit cd5d516
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion odoo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1909,7 +1909,7 @@ def _read_group_raw(self, domain, fields, groupby, offset=0, limit=None, orderby
prefix_term = lambda prefix, term: ('%s %s' % (prefix, term)) if term else ''

query = """
SELECT min("%(table)s".id) AS id, count("%(table)s".id) AS "%(count_field)s" %(extra_fields)s
SELECT min("%(table)s".id) AS id, count(DISTINCT "%(table)s".id) AS "%(count_field)s" %(extra_fields)s
FROM %(from)s
%(where)s
%(groupby)s
Expand Down

0 comments on commit cd5d516

Please sign in to comment.