refactor: prevent whole table scan while scheduling next date

- helps in concurrency isolation

(cherry picked from commit 21f4603144)
This commit is contained in:
ruthra kumar
2026-07-03 15:51:18 +05:30
parent 1ee8904a94
commit 6945e1292b

View File

@@ -1,7 +1,7 @@
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
# import frappe
import frappe
from frappe.model.document import Document
@@ -24,3 +24,10 @@ class ProcessPeriodClosingVoucherDetail(Document):
# end: auto-generated types
pass
def on_doctype_update():
frappe.db.add_index(
"Process Period Closing Voucher Detail",
["parent", "status", "parentfield", "idx", "processing_date"],
)