From e8a6933ff344cf819300e1a9713f9534132cbbcd Mon Sep 17 00:00:00 2001 From: Abdeali Chharchhoda Date: Wed, 20 May 2026 17:15:44 +0530 Subject: [PATCH] fix: update add_total_row_account to control blank row addition (cherry picked from commit f7c744350cf6d6c349c5081053eb371d9091704c) --- .../accounts/report/cash_flow/cash_flow.py | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/report/cash_flow/cash_flow.py b/erpnext/accounts/report/cash_flow/cash_flow.py index a62867ba91c..4ed34ab8eb9 100644 --- a/erpnext/accounts/report/cash_flow/cash_flow.py +++ b/erpnext/accounts/report/cash_flow/cash_flow.py @@ -132,7 +132,14 @@ def execute(filters=None): ) net_change_in_cash = add_total_row_account( - data, data, _("Net Change in Cash"), period_list, company_currency, summary_data, filters + data, + data, + _("Net Change in Cash"), + period_list, + company_currency, + summary_data, + filters, + add_blank_row=False, ) if filters.show_opening_and_closing_balance: @@ -250,7 +257,17 @@ def get_start_date(period, accumulated_values, company): return start_date -def add_total_row_account(out, data, label, period_list, currency, summary_data, filters, consolidated=False): +def add_total_row_account( + out, + data, + label, + period_list, + currency, + summary_data, + filters, + consolidated=False, + add_blank_row=True, +): total_row = { "section_name": "'" + _("{0}").format(label) + "'", "section": "'" + _("{0}").format(label) + "'", @@ -275,7 +292,9 @@ def add_total_row_account(out, data, label, period_list, currency, summary_data, total_row["total"] += row["total"] out.append(total_row) - out.append({}) + + if add_blank_row: + out.append({}) return total_row