From 4ce4d345e7bbf0220add415812a84d54e30068a0 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 (cherry picked from commit c9c45fe89f4a9e90ad78bc34b6ca2024770e295b) --- 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 3e026e104ad..b9cde43653a 100644 --- a/erpnext/accounts/doctype/account/account.py +++ b/erpnext/accounts/doctype/account/account.py @@ -304,7 +304,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}):