From ede2dea043bb0aaad1d55d2d87aefe6a4cea3d06 Mon Sep 17 00:00:00 2001 From: Kaushal Shriwas <64089478+kaulith@users.noreply.github.com> Date: Thu, 30 Apr 2026 13:20:16 +0530 Subject: [PATCH 1/3] fix(report): skip total row label for datetime/time first column --- frappe/desk/query_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/desk/query_report.py b/frappe/desk/query_report.py index aea21e2a37..29b18f2d1e 100644 --- a/frappe/desk/query_report.py +++ b/frappe/desk/query_report.py @@ -751,7 +751,7 @@ def add_total_row( else: first_col_fieldtype = columns[0].get("fieldtype") - if first_col_fieldtype not in ["Currency", "Int", "Float", "Percent", "Date"]: + if first_col_fieldtype not in ["Currency", "Int", "Float", "Percent", "Date", "Datetime", "Time"]: total_row[0] = _("Total") result.append(total_row) From eb76248c9952003560a1f13489bc3d181f5b51cb Mon Sep 17 00:00:00 2001 From: Kaushal Shriwas <64089478+kaulith@users.noreply.github.com> Date: Thu, 30 Apr 2026 15:24:38 +0530 Subject: [PATCH 2/3] refactor: extract non-labelable fieldtypes to constant --- frappe/desk/query_report.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frappe/desk/query_report.py b/frappe/desk/query_report.py index 29b18f2d1e..08a00ecc9b 100644 --- a/frappe/desk/query_report.py +++ b/frappe/desk/query_report.py @@ -678,6 +678,9 @@ def get_xlsx_styles(metadata: XLSXMetadata, report_name: str | None = None) -> d return styles +NON_LABELABLE_FIELDTYPES = ("Currency", "Int", "Float", "Percent", "Date", "Datetime", "Time") + + def add_total_row( result, columns, @@ -751,7 +754,7 @@ def add_total_row( else: first_col_fieldtype = columns[0].get("fieldtype") - if first_col_fieldtype not in ["Currency", "Int", "Float", "Percent", "Date", "Datetime", "Time"]: + if first_col_fieldtype not in NON_LABELABLE_FIELDTYPES: total_row[0] = _("Total") result.append(total_row) From e4e1c4af558afabea56ac7276a4e87d1ab1dc549 Mon Sep 17 00:00:00 2001 From: Kaushal Shriwas <64089478+kaulith@users.noreply.github.com> Date: Thu, 30 Apr 2026 16:37:31 +0530 Subject: [PATCH 3/3] refactor: better naming and move variable inside the scope --- frappe/desk/query_report.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/frappe/desk/query_report.py b/frappe/desk/query_report.py index 08a00ecc9b..2eaeeb3c1d 100644 --- a/frappe/desk/query_report.py +++ b/frappe/desk/query_report.py @@ -678,9 +678,6 @@ def get_xlsx_styles(metadata: XLSXMetadata, report_name: str | None = None) -> d return styles -NON_LABELABLE_FIELDTYPES = ("Currency", "Int", "Float", "Percent", "Date", "Datetime", "Time") - - def add_total_row( result, columns, @@ -754,7 +751,8 @@ def add_total_row( else: first_col_fieldtype = columns[0].get("fieldtype") - if first_col_fieldtype not in NON_LABELABLE_FIELDTYPES: + unsupported_col_types = ("Currency", "Int", "Float", "Percent", "Date", "Datetime", "Time") + if first_col_fieldtype not in unsupported_col_types: total_row[0] = _("Total") result.append(total_row)