mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-16 08:05:00 +00:00
fix: validate party and party type only if both available (#27002)
* fix: validate party and party type only if both available * fix: indentation
This commit is contained in:
@@ -78,13 +78,10 @@ def validate_filters(filters, account_details):
|
||||
def validate_party(filters):
|
||||
party_type, party = filters.get("party_type"), filters.get("party")
|
||||
|
||||
if party:
|
||||
if not party_type:
|
||||
frappe.throw(_("To filter based on Party, select Party Type first"))
|
||||
else:
|
||||
for d in party:
|
||||
if not frappe.db.exists(party_type, d):
|
||||
frappe.throw(_("Invalid {0}: {1}").format(party_type, d))
|
||||
if party and party_type:
|
||||
for d in party:
|
||||
if not frappe.db.exists(party_type, d):
|
||||
frappe.throw(_("Invalid {0}: {1}").format(party_type, d))
|
||||
|
||||
def set_account_currency(filters):
|
||||
if filters.get("account") or (filters.get('party') and len(filters.party) == 1):
|
||||
|
||||
Reference in New Issue
Block a user