My bad. I didn’t do that earlier. I just did and now it works!!! Thank you.
I however got the following errors on the attendance report:
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 62, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 22, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 53, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 939, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/query_report.py”, line 96, in run
res = frappe.get_attr(method_name)(frappe._dict(filters))
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py”, line 41, in execute
row.append(status_map[status])
KeyError: u’Out of Office’
So i added the following values to monthly_attendance_sheet.py:
row = [emp, emp_det.employee_name, emp_det.branch, emp_det.department, emp_det.designation,
emp_det.company]
total_p = total_a = total_l = 0.0
for day in range(filters[“total_days_in_month”]):
status = att_map.get(emp).get(day + 1, “None”)
status_map = {“Present”: “P”, “Absent”: “A”, “Out of Office”: “OA”, “Half Day”: “HD”, "On $
if status == “None” and holiday_map:
emp_holiday_list = emp_det.holiday_list if emp_det.holiday_list else default_holid$
if emp_holiday_list in holiday_map and (day+1) in holiday_map[emp_holiday_list]:
status = “Holiday”
row.append(status_map[status])
if status == “Present”:
total_p += 1
elif status == “Absent”:
total_a += 1
elif status == “Out of Office”
total_oa += 1
elif status == “On Leave”:
total_l += 1
elif status == “Half Day”:
total_p += 0.5
total_a += 0.5
row += [total_p, total_l, total_a]
data.append(row)
and then i now have this error:
Seems as though the filter query for year has been altered as i can no longer select the year filter. i have checked everything else and nothing seems amiss and i did not alter any other script.
I also noticed that the attendance doctype does not automatically register employees whose leave application have been approved. They still need to manually enter their attendance and select leave for their attendance to be registered.