From 5bd8132630cb3091cc36e89c12f4a69957ccb655 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Wed, 20 May 2026 10:40:15 +0530 Subject: [PATCH] fix: faster range calculation on process period closing voucher (cherry picked from commit ee33574a6d0a8d6b639a55f85dfc1504c086ff7a) --- .../process_period_closing_voucher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/process_period_closing_voucher/process_period_closing_voucher.py b/erpnext/accounts/doctype/process_period_closing_voucher/process_period_closing_voucher.py index c63c5652cb3..af9faeb396f 100644 --- a/erpnext/accounts/doctype/process_period_closing_voucher/process_period_closing_voucher.py +++ b/erpnext/accounts/doctype/process_period_closing_voucher/process_period_closing_voucher.py @@ -69,8 +69,8 @@ class ProcessPeriodClosingVoucher(Document): pcv = frappe.get_doc("Period Closing Voucher", self.parent_pcv) if pcv.is_first_period_closing_voucher(): gl = qb.DocType("GL Entry") - min = qb.from_(gl).select(Min(gl.posting_date)).where(gl.company.eq(pcv.company)).run()[0][0] - max = qb.from_(gl).select(Max(gl.posting_date)).where(gl.company.eq(pcv.company)).run()[0][0] + min = qb.from_(gl).select(Min(gl.posting_date)).run()[0][0] + max = qb.from_(gl).select(Max(gl.posting_date)).run()[0][0] dates = self.get_dates(get_datetime(min), get_datetime(max)) for x in dates: