Distinct does not work with count for a field

Description

If you try to count distinct contents of a field, AO does not generate the right SQL query and it ignores the specified field.

For example, this code:

generates the following SQL query

when the expected code should be something like:

Environment

None

Testing Notes

None

Assignee

Piotr Suwala

Reporter

Alejandro Conde Carrillo

Labels

None

Add-on Type

None

Team

None

CC

None

Risk factor

None

QA Kickoff Status

None

QA Demo Status

None

Fix versions

Priority

Major
Configure