Employee leave balance report fixes #1647

This commit is contained in:
Nabin Hait 2014-05-15 11:36:26 +05:30
parent 3c4dba3e51
commit bc7659ab90

View File

@ -3,6 +3,7 @@
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.widgets.reportview import execute as runreport
def execute(filters=None):
@ -12,6 +13,10 @@ def execute(filters=None):
[["Employee", "company", "=", filters.get("company")]] or None
employees = runreport(doctype="Employee", fields=["name", "employee_name", "department"],
filters=employee_filters)
if not employees:
frappe.throw(_("No employee found!"))
leave_types = frappe.db.sql_list("select name from `tabLeave Type`")
if filters.get("fiscal_year"):