From 3e2fb85ae6716e9e36a875866ea6fac1998265c4 Mon Sep 17 00:00:00 2001 From: diptanilsaha Date: Mon, 1 Sep 2025 15:15:42 +0530 Subject: [PATCH] fix(perf): applying consistent index to fetch gl entries for financial statements --- erpnext/accounts/report/financial_statements.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py index ba6c9887e11..6966c00e926 100644 --- a/erpnext/accounts/report/financial_statements.py +++ b/erpnext/accounts/report/financial_statements.py @@ -530,6 +530,7 @@ def get_accounting_entries( query = query.select(gl_entry.posting_date, gl_entry.is_opening, gl_entry.fiscal_year) query = query.where(gl_entry.is_cancelled == 0) query = query.where(gl_entry.posting_date <= to_date) + query = query.force_index("posting_date_company_index") if ignore_opening_entries and not ignore_is_opening: query = query.where(gl_entry.is_opening == "No")