Skip to content

Commit 4b84dcd

Browse files
authored
Merge pull request frappe#36378 from shubhdoshi21/aggregate-column-in-auto-email-report-fix
2 parents f83b744 + 87c3c71 commit 4b84dcd

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

frappe/core/doctype/report/report.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,10 @@ def get_report_module_dotted_path(module, report_name):
416416

417417
def get_group_by_field(args, doctype):
418418
if args["aggregate_function"] == "count":
419-
group_by_field = "count(*) as _aggregate_column"
419+
group_by_field = {"COUNT": "*", "as": "_aggregate_column"}
420420
else:
421-
group_by_field = f"{args.aggregate_function}({args.aggregate_on}) as _aggregate_column"
421+
func_name = args["aggregate_function"].upper()
422+
group_by_field = {func_name: args["aggregate_on"], "as": "_aggregate_column"}
422423

423424
return group_by_field
424425

0 commit comments

Comments
 (0)