From 8874f4a9e44ea249a11c9c2b7ca55c06a7602ef1 Mon Sep 17 00:00:00 2001 From: venkat102 Date: Thu, 2 Jan 2025 16:10:12 +0530 Subject: [PATCH 1/2] fix: ignore currency validation while canceling the voucher (cherry picked from commit 15d488b9aa97cf91aa7ac97b1870e4f5cd49acc8) --- erpnext/accounts/doctype/gl_entry/gl_entry.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py index d9d7807a561..c77a201ab51 100644 --- a/erpnext/accounts/doctype/gl_entry/gl_entry.py +++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py @@ -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) From 0f1c6ff1c9ca7e6a573b94ccc21789b3616951bb Mon Sep 17 00:00:00 2001 From: venkat102 Date: Thu, 2 Jan 2025 17:27:34 +0530 Subject: [PATCH 2/2] fix: ignore party account validation while canceling the voucher (cherry picked from commit 49885f8eae8c95e1b319c4e48ca64005ffa5b93d) --- erpnext/accounts/party.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index 3033b8ad087..396c814dff6 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -760,6 +760,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"]):