Error in biometric attendance for V14

2024-08-06 11:44:55,789 ERROR Error during ERPNext API Call. 69 1716878279.0 1 Traceback (most recent call last):
File “apps/frappe/frappe/handler.py”, line 75, in execute_cmd
method = get_attr(cmd)
File “apps/frappe/frappe/handler.py”, line 266, in get_attr
method = frappe.get_attr(cmd)
File “apps/frappe/frappe/init.py”, line 1609, in get_attr
return getattr(get_module(modulename), methodname)
File “apps/frappe/frappe/init.py”, line 1343, in get_module
return importlib.import_module(modulename)
File “/usr/lib/python3.10/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1050, in _gcd_import
File “”, line 1027, in _find_and_load
File “”, line 992, in _find_and_load_unlocked
File “”, line 241, in _call_with_frames_removed
File “”, line 1050, in _gcd_import
File “”, line 1027, in _find_and_load
File “”, line 992, in _find_and_load_unlocked
File “”, line 241, in _call_with_frames_removed
File “”, line 1050, in _gcd_import
File “”, line 1027, in _find_and_load
File “”, line 992, in _find_and_load_unlocked
File “”, line 241, in _call_with_frames_removed
File “”, line 1050, in _gcd_import
File “”, line 1027, in _find_and_load
File “”, line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘erpnext.hr’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 97, in application
response = frappe.api.handle()
File “apps/frappe/frappe/api.py”, line 55, in handle
return frappe.handler.handle()
File “apps/frappe/frappe/handler.py”, line 48, in handle
data = execute_cmd(cmd)
File “apps/frappe/frappe/handler.py”, line 77, in execute_cmd
frappe.throw(_(“Failed to get method for command {0} with {1}”).format(cmd, e))
File “apps/frappe/frappe/init.py”, line 548, in throw
msgprint(
File “apps/frappe/frappe/init.py”, line 509, in msgprint
_raise_exception()
File “apps/frappe/frappe/init.py”, line 455, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: Failed to get method for command erpnext.hr.doctype.employee_checkin.employee_checkin.add_log_based_on_employee_field with No module named ‘erpnext.hr’

2024-08-06 11:44:55,791 ERROR exception when calling pull_process_and_push_data function for device{“device_id”: “1”, “ip”: “192.168.1.22”, “punch_direction”: “”, “clear_from_device_on_fetch”: “”}
Traceback (most recent call last):
File “C:\Users\ddsla\OneDrive\Desktop\ZKTECO new Machine\TEST\biometric-attendance-sync-tool-v1.0-win32\biometric-attendance-sync-tool-v1.0-win32\erpnext_sync.py”, line 51, in main
pull_process_and_push_data(device, device_attendance_logs)
File “C:\Users\ddsla\OneDrive\Desktop\ZKTECO new Machine\TEST\biometric-attendance-sync-tool-v1.0-win32\biometric-attendance-sync-tool-v1.0-win32\erpnext_sync.py”, line 129, in pull_process_and_push_data
raise Exception(‘API Call to ERPNext Failed.’)
Exception: API Call to ERPNext Failed.
2024-08-06 11:44:58,704 ERROR Error during ERPNext API Call. 573 1716808957.0 2 Traceback (most recent call last):
File “apps/frappe/frappe/handler.py”, line 75, in execute_cmd
method = get_attr(cmd)
File “apps/frappe/frappe/handler.py”, line 266, in get_attr
method = frappe.get_attr(cmd)
File “apps/frappe/frappe/init.py”, line 1609, in get_attr
return getattr(get_module(modulename), methodname)
File “apps/frappe/frappe/init.py”, line 1343, in get_module
return importlib.import_module(modulename)
File “/usr/lib/python3.10/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1050, in _gcd_import
File “”, line 1027, in _find_and_load
File “”, line 992, in _find_and_load_unlocked
File “”, line 241, in _call_with_frames_removed
File “”, line 1050, in _gcd_import
File “”, line 1027, in _find_and_load
File “”, line 992, in _find_and_load_unlocked
File “”, line 241, in _call_with_frames_removed
File “”, line 1050, in _gcd_import
File “”, line 1027, in _find_and_load
File “”, line 992, in _find_and_load_unlocked
File “”, line 241, in _call_with_frames_removed
File “”, line 1050, in _gcd_import
File “”, line 1027, in _find_and_load
File “”, line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘erpnext.hr’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 97, in application
response = frappe.api.handle()
File “apps/frappe/frappe/api.py”, line 55, in handle
return frappe.handler.handle()
File “apps/frappe/frappe/handler.py”, line 48, in handle
data = execute_cmd(cmd)
File “apps/frappe/frappe/handler.py”, line 77, in execute_cmd
frappe.throw(_(“Failed to get method for command {0} with {1}”).format(cmd, e))
File “apps/frappe/frappe/init.py”, line 548, in throw
msgprint(
File “apps/frappe/frappe/init.py”, line 509, in msgprint
_raise_exception()
File “apps/frappe/frappe/init.py”, line 455, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: Failed to get method for command erpnext.hr.doctype.employee_checkin.employee_checkin.add_log_based_on_employee_field with No module named ‘erpnext.hr’

2024-08-06 11:44:58,707 ERROR exception when calling pull_process_and_push_data function for device{“device_id”: “2”, “ip”: “192.168.1.23”, “punch_direction”: “”, “clear_from_device_on_fetch”: “”}
Traceback (most recent call last):
File “C:\Users\ddsla\OneDrive\Desktop\ZKTECO new Machine\TEST\biometric-attendance-sync-tool-v1.0-win32\biometric-attendance-sync-tool-v1.0-win32\erpnext_sync.py”, line 51, in main
pull_process_and_push_data(device, device_attendance_logs)
File “C:\Users\ddsla\OneDrive\Desktop\ZKTECO new Machine\TEST\biometric-attendance-sync-tool-v1.0-win32\biometric-attendance-sync-tool-v1.0-win32\erpnext_sync.py”, line 129, in pull_process_and_push_data
raise Exception(‘API Call to ERPNext Failed.’)
Exception: API Call to ERPNext Failed.

@Sanath_Udayawansa2 in v13 and less the hr module was inside erpnext . after upgradign to v14 . it was removed to a separate module called hrms .
so when calling the function erpnext.hr.doctype.employee_checkin.employee_checkin.add_log_based_on_employee_field you are getting erpnext.hr not found . so try changing it to hrms.hr...
of course app hrms should be installed.

How to change that?