Merge pull request #49407 from diptanilsaha/force_index_fetch_gle

fix(perf): applying consistent index to fetch gl entries for financial statements
This commit is contained in:
Diptanil Saha
2025-09-02 12:11:48 +05:30
committed by GitHub

View File

@@ -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")