fix: wrong company selected when marking attendance for all employees (#27685)

* fix: wrong company selected when marking attendance for all employees

* fix: enable caching for repeated queries of the same employee

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
This commit is contained in:
Mohammed Yusuf Shaikh
2021-09-30 12:02:39 +05:30
committed by GitHub
parent 471a8ddce0
commit b478e72cef

View File

@@ -55,8 +55,7 @@ def mark_employee_attendance(employee_list, status, date, leave_type=None, compa
else:
leave_type = None
if not company:
company = frappe.db.get_value("Employee", employee['employee'], "Company")
company = frappe.db.get_value("Employee", employee['employee'], "Company", cache=True)
attendance=frappe.get_doc(dict(
doctype='Attendance',
@@ -68,4 +67,4 @@ def mark_employee_attendance(employee_list, status, date, leave_type=None, compa
company=company
))
attendance.insert()
attendance.submit()
attendance.submit()