mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-23 15:09:20 +00:00
Merge pull request #49419 from frappe/mergify/bp/version-15-hotfix/pr-49407
fix(perf): applying consistent index to fetch gl entries for financial statements (backport #49407)
This commit is contained in:
@@ -532,6 +532,7 @@ def get_accounting_entries(
|
|||||||
query = query.select(gl_entry.posting_date, gl_entry.is_opening, gl_entry.fiscal_year)
|
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.is_cancelled == 0)
|
||||||
query = query.where(gl_entry.posting_date <= to_date)
|
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:
|
if ignore_opening_entries and not ignore_is_opening:
|
||||||
query = query.where(gl_entry.is_opening == "No")
|
query = query.where(gl_entry.is_opening == "No")
|
||||||
|
|||||||
Reference in New Issue
Block a user