[fix] validate party account (#11517)
This commit is contained in:
parent
731b66b788
commit
0f86d86e27
@ -176,7 +176,9 @@ def get_party_account(party_type, party, company):
|
|||||||
if not company:
|
if not company:
|
||||||
frappe.throw(_("Please select a Company"))
|
frappe.throw(_("Please select a Company"))
|
||||||
|
|
||||||
if party:
|
if not party:
|
||||||
|
frappe.throw(_("Please select a Party"))
|
||||||
|
|
||||||
account = frappe.db.get_value("Party Account",
|
account = frappe.db.get_value("Party Account",
|
||||||
{"parenttype": party_type, "parent": party, "company": company}, "account")
|
{"parenttype": party_type, "parent": party, "company": company}, "account")
|
||||||
|
|
||||||
@ -198,6 +200,9 @@ def get_party_account(party_type, party, company):
|
|||||||
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)
|
||||||
|
|
||||||
|
if not account:
|
||||||
|
frappe.throw(_("Party account not specified, please setup default party account in company"))
|
||||||
|
|
||||||
return account
|
return account
|
||||||
|
|
||||||
def get_party_account_currency(party_type, party, company):
|
def get_party_account_currency(party_type, party, company):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user