Merge pull request #48928 from frappe/mergify/bp/version-15-hotfix/pr-48748

fix: account currency validation to exclude cancelled entries (backport #48748)
This commit is contained in:
Mihir Kandoi
2025-08-02 22:34:05 +05:30
committed by GitHub

View File

@@ -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}):