From c9c45fe89f4a9e90ad78bc34b6ca2024770e295b Mon Sep 17 00:00:00 2001 From: Dev Dusija Date: Tue, 22 Jul 2025 23:56:48 +0530 Subject: [PATCH] fix: account currency validation to exclude cancelled entries --- erpnext/accounts/doctype/account/account.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py index 0de00681487..0db982ad426 100644 --- a/erpnext/accounts/doctype/account/account.py +++ b/erpnext/accounts/doctype/account/account.py @@ -302,7 +302,9 @@ class Account(NestedSet): self.account_currency = frappe.get_cached_value("Company", self.company, "default_currency") self.currency_explicitly_specified = False - gl_currency = frappe.db.get_value("GL Entry", {"account": self.name}, "account_currency") + gl_currency = frappe.db.get_value( + "GL Entry", {"account": self.name, "is_cancelled": 0}, "account_currency" + ) if gl_currency and self.account_currency != gl_currency: if frappe.db.get_value("GL Entry", {"account": self.name}):