fix: Party name field in trial balacne for party report (#19789)
This commit is contained in:
parent
36b60dbbef
commit
8d31171ff8
@ -18,11 +18,14 @@ def execute(filters=None):
|
|||||||
return columns, data
|
return columns, data
|
||||||
|
|
||||||
def get_data(filters, show_party_name):
|
def get_data(filters, show_party_name):
|
||||||
|
if filters.get('party_type') in ('Customer', 'Supplier', 'Employee', 'Member'):
|
||||||
party_name_field = "{0}_name".format(frappe.scrub(filters.get('party_type')))
|
party_name_field = "{0}_name".format(frappe.scrub(filters.get('party_type')))
|
||||||
if filters.get('party_type') == 'Student':
|
if filters.get('party_type') == 'Student':
|
||||||
party_name_field = 'first_name'
|
party_name_field = 'first_name'
|
||||||
elif filters.get('party_type') == 'Shareholder':
|
elif filters.get('party_type') == 'Shareholder':
|
||||||
party_name_field = 'title'
|
party_name_field = 'title'
|
||||||
|
else:
|
||||||
|
party_name_field = 'name'
|
||||||
|
|
||||||
party_filters = {"name": filters.get("party")} if filters.get("party") else {}
|
party_filters = {"name": filters.get("party")} if filters.get("party") else {}
|
||||||
parties = frappe.get_all(filters.get("party_type"), fields = ["name", party_name_field],
|
parties = frappe.get_all(filters.get("party_type"), fields = ["name", party_name_field],
|
||||||
|
Loading…
Reference in New Issue
Block a user