Skip to content

Commit

Permalink
fix: wrong company selected when marking attendance for all employees (
Browse files Browse the repository at this point in the history
…frappe#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>
  • Loading branch information
mohammedyusufshaikh and ankush authored Sep 30, 2021
1 parent 471a8dd commit b478e72
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -68,4 +67,4 @@ def mark_employee_attendance(employee_list, status, date, leave_type=None, compa
company=company
))
attendance.insert()
attendance.submit()
attendance.submit()

0 comments on commit b478e72

Please sign in to comment.