Merge pull request #48748 from devdusija/fix/account-currency-validation

fix: account currency validation to exclude cancelled entries
This commit is contained in:
Mihir Kandoi
2025-08-02 22:17:14 +05:30
committed by GitHub

View File

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