Merge pull request #45051 from aerele/currency-validation

fix: ignore currency validation while canceling the voucher
This commit is contained in:
ruthra kumar
2025-01-06 08:25:05 +05:30
committed by GitHub
2 changed files with 6 additions and 0 deletions

View File

@@ -275,6 +275,9 @@ class GLEntry(Document):
validate_account_party_type(self)
def validate_currency(self):
if self.is_cancelled:
return
company_currency = erpnext.get_company_currency(self.company)
account_currency = get_account_currency(self.account)

View File

@@ -765,6 +765,9 @@ def validate_party_frozen_disabled(party_type, party_name):
def validate_account_party_type(self):
if self.is_cancelled:
return
if self.party_type and self.party:
account_type = frappe.get_cached_value("Account", self.account, "account_type")
if account_type and (account_type not in ["Receivable", "Payable"]):