From a04feff2646e037536c3abd1c6a71f49ea40fc4b Mon Sep 17 00:00:00 2001 From: ljain112 Date: Tue, 13 May 2025 13:12:39 +0530 Subject: [PATCH] fix: ignore "Account Closing Balance" doctype on Period Closing Voucher cancellation (cherry picked from commit d6602d63fcb69d78560762e9a86c0b6bf8adbbdc) # Conflicts: # erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py --- .../period_closing_voucher/period_closing_voucher.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py index 59ffd656689..5119562382f 100644 --- a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py +++ b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py @@ -32,8 +32,13 @@ class PeriodClosingVoucher(AccountsController): def on_cancel(self): self.validate_future_closing_vouchers() + self.ignore_linked_doctypes = ( + "GL Entry", + "Stock Ledger Entry", + "Payment Ledger Entry", + "Account Closing Balance", + ) self.db_set("gle_processing_status", "In Progress") - self.ignore_linked_doctypes = ("GL Entry", "Stock Ledger Entry", "Payment Ledger Entry") gle_count = frappe.db.count( "GL Entry", {"voucher_type": "Period Closing Voucher", "voucher_no": self.name, "is_cancelled": 0},