diff --git a/erpnext/hr/doctype/attendance/attendance.py b/erpnext/hr/doctype/attendance/attendance.py index dd7eb0f5021..2e734f2aa30 100644 --- a/erpnext/hr/doctype/attendance/attendance.py +++ b/erpnext/hr/doctype/attendance/attendance.py @@ -5,8 +5,16 @@ import frappe from frappe import _ from frappe.model.document import Document -from frappe.query_builder import Criterion -from frappe.utils import cint, cstr, formatdate, get_datetime, get_link_to_form, getdate, nowdate, add_days +from frappe.utils import ( + add_days, + cint, + cstr, + formatdate, + get_datetime, + get_link_to_form, + getdate, + nowdate, +) from erpnext.hr.utils import get_holiday_dates_for_employee, validate_active_employee @@ -107,8 +115,6 @@ class Attendance(Document): frappe.throw(_("Employee {0} is not active or does not exist").format(self.employee)) def unlink_attendance_from_checkins(self): - from frappe.utils import get_link_to_form - EmployeeCheckin = frappe.qb.DocType("Employee Checkin") linked_logs = ( frappe.qb.from_(EmployeeCheckin) diff --git a/erpnext/hr/doctype/attendance/test_attendance.py b/erpnext/hr/doctype/attendance/test_attendance.py index 82a162e777a..bcb1cf88609 100644 --- a/erpnext/hr/doctype/attendance/test_attendance.py +++ b/erpnext/hr/doctype/attendance/test_attendance.py @@ -14,11 +14,8 @@ from frappe.utils import ( nowdate, ) -from erpnext.setup.doctype.employee.test_employee import make_employee -from erpnext.hr.doctype.attendance.attendance import ( - get_unmarked_days, - mark_attendance, -) +from erpnext.hr.doctype.attendance.attendance import get_unmarked_days, mark_attendance +from erpnext.hr.doctype.employee.test_employee import make_employee from erpnext.hr.tests.test_utils import get_first_sunday test_records = frappe.get_test_records("Attendance") @@ -57,9 +54,7 @@ class TestAttendance(FrappeTestCase): mark_attendance(employee, attendance_date, "Present") unmarked_days = get_unmarked_days( - employee, - get_first_day(attendance_date), - get_last_day(attendance_date) + employee, get_first_day(attendance_date), get_last_day(attendance_date) ) unmarked_days = [getdate(date) for date in unmarked_days] @@ -86,10 +81,7 @@ class TestAttendance(FrappeTestCase): mark_attendance(employee, attendance_date, "Present") unmarked_days = unmarked_days = get_unmarked_days( - employee, - get_first_day(attendance_date), - get_last_day(attendance_date), - exclude_holidays=True + employee, get_first_day(attendance_date), get_last_day(attendance_date), exclude_holidays=True ) unmarked_days = [getdate(date) for date in unmarked_days] @@ -119,9 +111,7 @@ class TestAttendance(FrappeTestCase): mark_attendance(employee, attendance_date, "Present") unmarked_days = get_unmarked_days( - employee, - get_first_day(attendance_date), - get_last_day(attendance_date) + employee, get_first_day(attendance_date), get_last_day(attendance_date) ) unmarked_days = [getdate(date) for date in unmarked_days]