mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-19 02:04:50 +00:00
fix: don't validate for currency, if account is unavailable
(cherry picked from commit 3cde81be65)
This commit is contained in:
@@ -56,17 +56,17 @@ class BankTransaction(Document):
|
|||||||
Bank Transaction should be on the same currency as the Bank Account.
|
Bank Transaction should be on the same currency as the Bank Account.
|
||||||
"""
|
"""
|
||||||
if self.currency and self.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")
|
account_currency = frappe.get_cached_value("Account", account, "account_currency")
|
||||||
|
|
||||||
if self.currency != account_currency:
|
if self.currency != account_currency:
|
||||||
frappe.throw(
|
frappe.throw(
|
||||||
_(
|
_(
|
||||||
"Transaction currency: {0} cannot be different from Bank Account({1}) currency: {2}"
|
"Transaction currency: {0} cannot be different from Bank Account({1}) currency: {2}"
|
||||||
).format(
|
).format(
|
||||||
frappe.bold(self.currency), frappe.bold(self.bank_account), frappe.bold(account_currency)
|
frappe.bold(self.currency), frappe.bold(self.bank_account), frappe.bold(account_currency)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
|
||||||
|
|
||||||
def set_status(self):
|
def set_status(self):
|
||||||
if self.docstatus == 2:
|
if self.docstatus == 2:
|
||||||
|
|||||||
Reference in New Issue
Block a user