fix: party account based on party type's account type

(cherry picked from commit 19b1650522)
This commit is contained in:
ljain112
2025-05-26 15:55:55 +05:30
committed by Mergify
parent 60dfe36195
commit d3d22f699e

View File

@@ -460,6 +460,12 @@ def get_party_account(party_type, party=None, company=None, include_advance=Fals
if (account and account_currency != existing_gle_currency) or not account:
account = get_party_gle_account(party_type, party, company)
# get default account on the basis of party type
if not account:
account_type = frappe.get_cached_value("Party Type", party_type, "account_type")
default_account_name = "default_" + account_type.lower() + "_account"
account = frappe.get_cached_value("Company", company, default_account_name)
if include_advance and party_type in ["Customer", "Supplier", "Student"]:
advance_account = get_party_advance_account(party_type, party, company)
if advance_account: