From 305c37917ffe7188c9270f8f5ca8b37301990889 Mon Sep 17 00:00:00 2001 From: Anand Baburajan Date: Mon, 17 Jul 2023 11:00:19 +0530 Subject: [PATCH] chore: add validation for account type of party type and account (#36141) chore: add validation to check if account type of party type and account match --- erpnext/accounts/doctype/journal_entry/journal_entry.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index 83312dbd22..ea4a2d4b19 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -408,6 +408,15 @@ class JournalEntry(AccountsController): d.idx, d.account ) ) + elif ( + d.party_type + and frappe.db.get_value("Party Type", d.party_type, "account_type") != account_type + ): + frappe.throw( + _("Row {0}: Account {1} and Party Type {2} have different account types").format( + d.idx, d.account, d.party_type + ) + ) def check_credit_limit(self): customers = list(