fix Report not working on parameter Grade (#21951)

This commit is contained in:
Anurag Mishra 2020-05-27 12:26:54 +05:30 committed by GitHub
parent da95601c12
commit 01bced8c67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,7 +26,7 @@ def get_columns():
return [
_("Employee") + ":Link/Employee:120", _("Name") + ":Data:200", _("Date of Birth")+ ":Date:100",
_("Branch") + ":Link/Branch:120", _("Department") + ":Link/Department:120",
_("Designation") + ":Link/Designation:120", _("Gender") + "::60", _("Company") + ":Link/Company:120"
_("Designation") + ":Link/Designation:120", _("Gender") + "::100", _("Company") + ":Link/Company:120"
]
def get_conditions(filters):
@ -43,7 +43,12 @@ def get_employees(filters):
gender, company from `tabEmployee` where status = 'Active' %s""" % conditions, as_list=1)
def get_parameters(filters):
return frappe.db.sql("""select name from `tab"""+filters.get("parameter")+"""` """, as_list=1)
if filters.get("parameter") == "Grade":
parameter = "Employee Grade"
else:
parameter = filters.get("parameter")
return frappe.db.sql("""select name from `tab"""+ parameter +"""` """, as_list=1)
def get_chart_data(parameters,employees, filters):
if not parameters: