Minor fix in monthly attendance report

Cherry-picked and modified by @anandpdoshi

Conflicts:
	hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py
This commit is contained in:
Nabin Hait 2014-04-01 18:54:15 +05:30 committed by Anand Doshi
parent 6298536e46
commit 450d9d72d7

View File

@ -17,6 +17,9 @@ def execute(filters=None):
data = []
for emp in sorted(att_map):
emp_det = emp_map.get(emp)
if not emp_det:
continue
row = [emp, emp_det.employee_name, emp_det.branch, emp_det.department, emp_det.designation,
emp_det.company]
@ -84,11 +87,11 @@ def get_conditions(filters):
return conditions, filters
def get_employee_details():
employee = frappe.db.sql("""select name, employee_name, designation, department,
branch, company from tabEmployee where docstatus < 2 and status = 'Active'""", as_dict=1)
emp_map = {}
for emp in employee:
emp_map[emp.name] = emp
emp_map = frappe._dict()
for d in frappe.db.sql("""select name, employee_name, designation,
department, branch, company
from tabEmployee where docstatus < 2
and status = 'Active'""", as_dict=1):
emp_map.setdefault(d.name, d)
return emp_map