fix: Do no query GLs if no PCVs are posted

(cherry picked from commit f4d1a54588)
This commit is contained in:
Deepesh Garg
2025-01-22 13:46:37 +05:30
committed by Mergify
parent b9fcc786fa
commit 5d04501454

View File

@@ -18,6 +18,8 @@ def execute():
frappe.db.truncate("Account Closing Balance") frappe.db.truncate("Account Closing Balance")
pcv_list = get_period_closing_vouchers() pcv_list = get_period_closing_vouchers()
if pcv_list:
gl_entries = get_gl_entries(pcv_list) gl_entries = get_gl_entries(pcv_list)
for _, pcvs in itertools.groupby(pcv_list, key=lambda pcv: (pcv.company, pcv.period_start_date)): for _, pcvs in itertools.groupby(pcv_list, key=lambda pcv: (pcv.company, pcv.period_start_date)):