fix: do not validate party against Receivable and Payable account for cancelled gl entries

(cherry picked from commit 0809e00455)
This commit is contained in:
ljain112
2025-02-07 18:30:26 +05:30
committed by Mergify
parent ca9df9db07
commit 9f79da0015

View File

@@ -83,7 +83,7 @@ class GLEntry(Document):
if not self.get(k): if not self.get(k):
frappe.throw(_("{0} is required").format(_(self.meta.get_label(k)))) frappe.throw(_("{0} is required").format(_(self.meta.get_label(k))))
if not (self.party_type and self.party): if not self.is_cancelled and not (self.party_type and self.party):
account_type = frappe.get_cached_value("Account", self.account, "account_type") account_type = frappe.get_cached_value("Account", self.account, "account_type")
if account_type == "Receivable": if account_type == "Receivable":
frappe.throw( frappe.throw(