psycopg2.errors.GroupingError

I use postgres database and the frappe.get_all() with group By return this error :

psycopg2.errors.GroupingError: column "tabOperations.code" must appear in the GROUP BY clause or be used in an aggregate function
Traceback (most recent call last):
  File "apps/frappe/frappe/desk/query_report.py", line 224, in run
    result = generate_report_result(report, filters, user, custom_columns, is_tree, parent_field)
  File "apps/frappe/frappe/__init__.py", line 960, in wrapper_fn
    retval = fn(*args, **get_newargs(fn, kwargs))
  File "apps/frappe/frappe/desk/query_report.py", line 84, in generate_report_result
    res = get_report_result(report, filters) or []
  File "apps/frappe/frappe/desk/query_report.py", line 65, in get_report_result
    res = report.execute_script_report(filters)
  File "apps/frappe/frappe/core/doctype/report/report.py", line 166, in execute_script_report
    res = self.execute_module(filters)
  File "apps/frappe/frappe/core/doctype/report/report.py", line 183, in execute_module
    return frappe.get_attr(method_name)(frappe._dict(filters))
  File "apps/appre/appre/regles_de_calculs/report/prime/prime.py", line 9, in execute
    columns, data = get_columns(filters), get_data(filters)
  File "apps/appre/appre/regles_de_calculs/report/prime/prime.py", line 59, in get_data
    conv_b_list = frappe.get_list("Operations",
  File "apps/frappe/frappe/__init__.py", line 2087, in get_list
    return frappe.model.db_query.DatabaseQuery(doctype).execute(*args, **kwargs)
  File "apps/frappe/frappe/model/db_query.py", line 203, in execute
    result = self.build_and_run()
  File "apps/frappe/frappe/model/db_query.py", line 244, in build_and_run
    return frappe.db.sql(
  File "apps/frappe/frappe/database/postgres/database.py", line 233, in sql
    return super().sql(modify_query(query), modify_values(values), *args, **kwargs)
  File "apps/frappe/frappe/database/database.py", line 238, in sql
    self._cursor.execute(query, values)
psycopg2.errors.GroupingError: column "tabOperations.code" must appear in the GROUP BY clause or be used in an aggregate function

How can i resolve this problem

i resolve the problem by :


conv_b_list = frappe.get_list("Operations",
		fields=["code", "code_risque", "sum(montant) montant"],
		group_by='code_section')

become

conv_b_list = frappe.get_list("Operations",
		fields=["code", "code_risque", "sum(montant) montant"],
		group_by='code_section, code, code_risque')