fix: don't validate for currency, if account is unavailable

(cherry picked from commit 3cde81be65)
This commit is contained in:
ruthra kumar
2024-03-17 06:34:17 +05:30
committed by Mergify
parent 823e377ef1
commit 5729ee563c

View File

@@ -56,7 +56,7 @@ class BankTransaction(Document):
Bank Transaction should be on the same currency as the Bank Account.
"""
if self.currency and self.bank_account:
account = frappe.get_cached_value("Bank Account", self.bank_account, "account")
if account := frappe.get_cached_value("Bank Account", self.bank_account, "account"):
account_currency = frappe.get_cached_value("Account", account, "account_currency")
if self.currency != account_currency: