mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 15:12:51 +00:00
[fix] validate party account (#11517)
This commit is contained in:
@@ -176,7 +176,9 @@ def get_party_account(party_type, party, company):
|
||||
if not 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",
|
||||
{"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:
|
||||
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
|
||||
|
||||
def get_party_account_currency(party_type, party, company):
|
||||
|
||||
Reference in New Issue
Block a user