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 for account type of party type and account (#36141)

chore: add validation to check if account type of party type and account match
(cherry picked from commit 305c379)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
  • Loading branch information
mergify[bot] and anandbaburajan committed Jul 17, 2023
1 parent 120de24 commit 287c67f
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 @@ -400,6 +400,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 287c67f

Please sign in to comment.