mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-23 21:22:42 +01:00
fix: party account based on party type's account type
(cherry picked from commit 19b1650522)
This commit is contained in:
@@ -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:
|
if (account and account_currency != existing_gle_currency) or not account:
|
||||||
account = get_party_gle_account(party_type, party, company)
|
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"]:
|
if include_advance and party_type in ["Customer", "Supplier", "Student"]:
|
||||||
advance_account = get_party_advance_account(party_type, party, company)
|
advance_account = get_party_advance_account(party_type, party, company)
|
||||||
if advance_account:
|
if advance_account:
|
||||||
|
|||||||
Reference in New Issue
Block a user