Skip to content

Commit

Permalink
chore: add validation for account type of party type and account (#36141
Browse files Browse the repository at this point in the history
)

chore: add validation to check if account type of party type and account match
  • Loading branch information
anandbaburajan authored Jul 17, 2023
1 parent 2607847 commit 305c379
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions erpnext/accounts/doctype/journal_entry/journal_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,15 @@ def validate_party(self):
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(
Expand Down

0 comments on commit 305c379

Please sign in to comment.