Employee leave balance report fixes #1647
This commit is contained in:
parent
3c4dba3e51
commit
bc7659ab90
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
|
from frappe import _
|
||||||
from frappe.widgets.reportview import execute as runreport
|
from frappe.widgets.reportview import execute as runreport
|
||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
@ -12,6 +13,10 @@ def execute(filters=None):
|
|||||||
[["Employee", "company", "=", filters.get("company")]] or None
|
[["Employee", "company", "=", filters.get("company")]] or None
|
||||||
employees = runreport(doctype="Employee", fields=["name", "employee_name", "department"],
|
employees = runreport(doctype="Employee", fields=["name", "employee_name", "department"],
|
||||||
filters=employee_filters)
|
filters=employee_filters)
|
||||||
|
|
||||||
|
if not employees:
|
||||||
|
frappe.throw(_("No employee found!"))
|
||||||
|
|
||||||
leave_types = frappe.db.sql_list("select name from `tabLeave Type`")
|
leave_types = frappe.db.sql_list("select name from `tabLeave Type`")
|
||||||
|
|
||||||
if filters.get("fiscal_year"):
|
if filters.get("fiscal_year"):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user