PostgreSQL Error: "column must appear in the GROUP BY clause" in a List View

Hello everyone,

I am encountering an error while using PostgreSQL in a Frappe environment when trying to display a List View for the Section Doctype. i have link field to Contrat Doctype the “Show Title in Link Fields” option is enabled for title numero_contrat in Contrat Doctype The error is as follows:

psycopg2.errors.GroupingError: column "tabContrat_1.numero_contrat" must appear in the GROUP BY clause or be used in an aggregate function

The field contrat is a mandatory field in the Section Doctype.
The error only occurs if the contrat field is marked as mandatory.

How can I handle this situation in Frappe to avoid this error while keeping contrat as a mandatory field? Is there a clean way to configure this directly in the framework or in the List View script?

Thank you in advance for your help!

any help !

Hi,

I don’t know if the List View script can be modified in this case but a search for the error message finds some posts that may be useful.

For example: https://www.geeksforgeeks.org/how-to-solve-must-appear-in-the-group-by-clause-in-sql/

Sorry I don’t know if this is something that can be easily fixed or not.