Connection ZKTeco with ERPNext

@kanuns, currently this is not supported, but it should be a single line feature to add to the script. Do open a feature request at Issues · frappe/biometric-attendance-sync-tool · GitHub. Or please send a PR if you manage to fix it yourself.

The fix will be in this line:

@karthikeyan5

I could fetch data from the biometric device(according to “2023-01-31 17:35:37,366 INFO 192.168.1.199 Attendances Fetched: 37678” in logs.log ) but I have this error in my error.log:

2023-01-31 17:03:32,726 ERROR Error during ERPNext API Call. 1000 1674647885.0 1 Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 69, 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 38, in handle
data = execute_cmd(cmd)
File “apps/frappe/frappe/handler.py”, line 76, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “apps/frappe/frappe/init.py”, line 1457, in call
return fn(*args, **newargs)
File “apps/erpnext/erpnext/hr/doctype/employee_checkin/employee_checkin.py”, line 103, in add_log_based_on_employee_field
doc.insert()
File “apps/frappe/frappe/model/document.py”, line 261, in insert
self.run_before_save_methods()
File “apps/frappe/frappe/model/document.py”, line 1052, in run_before_save_methods
self.run_method(“validate”)
File “apps/frappe/frappe/model/document.py”, line 941, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 1259, in composer
return composed(self, method, *args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 1241, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “apps/frappe/frappe/model/document.py”, line 938, in fn
return method_object(*args, **kwargs)
File “apps/erpnext/erpnext/hr/doctype/employee_checkin/employee_checkin.py”, line 19, in validate
self.validate_duplicate_log()
File “apps/erpnext/erpnext/hr/doctype/employee_checkin/employee_checkin.py”, line 28, in validate_duplicate_log
frappe.throw(
File “apps/frappe/frappe/init.py”, line 504, in throw
msgprint(
File “apps/frappe/frappe/init.py”, line 479, in msgprint
_raise_exception()
File “apps/frappe/frappe/init.py”, line 434, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: This employee already has a log with the same timestamp.
Employee Checkin EMP-CKIN-01-2023-000005

2023-01-31 17:03:32,726 ERROR exception when calling pull_process_and_push_data function for device{“device_id”: “1”, “ip”: “192.168.1.199”, “punch_direction”: “”, “clear_from_device_on_fetch”: “”}
Traceback (most recent call last):
File “C:\Users\Mehdi\Downloads\biometric-attendance-sync-tool-v1.0-win64\erpnext_sync.py”, line 51, in main
pull_process_and_push_data(device, device_attendance_logs)
File “C:\Users\Mehdi\Downloads\biometric-attendance-sync-tool-v1.0-win64\erpnext_sync.py”, line 129, in pull_process_and_push_data
raise Exception(‘API Call to ERPNext Failed.’)
Exception: API Call to ERPNext Failed.

I don’t have any idea what I should do.

I appreciate any help.

The quick solution will be to go to Employee Checkin doctype and find this record EMP-CKIN-01-2023-000005 and delete it and restart the sync process. I believe the latest version of the tool has some functions to bypass this restriction. So check the documentation or a quick search for other posts about time attendance should tell you how to enable the bypass.

Hope This helps

2 Likes

@flexy2ky
Thank you for your help. It works and I have successful attendance in ERPNext. But it doesn’t have a log type(IN/OUT). Would you please tell me what I should do?

Thank you in advance

That is dependent on your biometric machine.

1 Like

There is some info about log type in following post that might be relevant to your question.

2 Likes

thanks, hopefully it is fixed.

thank you so much.

Thank you for your instructions, and I did all steps, But I have a comment, there is no file named “push_to_erpnext.py” in GitHub - frappe/biometric-attendance-sync-tool: A simple tool for syncing Biometric Attendance data with your ERPNext server

I did all steps, but I cant make auto attendance with ERPNext.
Can you share a video for this steps?

1 Like

Thanks a lot for your perfect video. When I run the file “erpnext_sync.py” as https://youtu.be/KhfncWCcu68?t=277 It shows Service Running" only and didnt show any data behind “Service Dunning” and also without any change at ERPNext.

Thanks a lot for your perfect video. When I run the file “erpnext_sync.py” as https://youtu.be/KhfncWCcu68?t=277 It shows Service Running" only and didnt show any data behind “Service Dunning” and also without any change at ERPNext.

Hi.

I know that this is an old post. But I need help. I am facing the following Error.

I am using Version 14, I have updated it from version 13. The script was working fine in the version 13. However when I upgraded, I lost all the data, I had to input all the data again. Now the syincing is not working. Can anyone help me in this error.

Yes I have checked the API Secret, it is same in the ERP as well as in the local_config.py file

To cut short, following is the error.

ModuleNotFoundError: No module named ‘erpnext.hr.doctype.employee_checkin.employee_checkin’

2023-03-30 02:39:16,383 ERROR Error during ERPNext API Call. 1 1666863029.0 4th Floor IN Traceback (most recent call last):
File “apps/frappe/frappe/handler.py”, line 72, in execute_cmd
method = get_attr(cmd)
File “apps/frappe/frappe/handler.py”, line 258, in get_attr
method = frappe.get_attr(cmd)
File “apps/frappe/frappe/init.py”, line 1577, in get_attr
return getattr(get_module(modulename), methodname)
File “apps/frappe/frappe/init.py”, line 1319, 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 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘erpnext.hr.doctype.employee_checkin.employee_checkin’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 69, in application
response = frappe.api.handle()
File “apps/frappe/frappe/api.py”, line 54, in handle
return frappe.handler.handle()
File “apps/frappe/frappe/handler.py”, line 45, in handle
data = execute_cmd(cmd)
File “apps/frappe/frappe/handler.py”, line 74, in execute_cmd
frappe.throw(_(“Failed to get method for command {0} with {1}”).format(cmd, e))
File “apps/frappe/frappe/init.py”, line 522, in throw
msgprint(
File “apps/frappe/frappe/init.py”, line 490, in msgprint
_raise_exception()
File “apps/frappe/frappe/init.py”, line 442, 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.doctype.employee_checkin.employee_checkin’

2023-03-30 02:39:16,384 ERROR exception when calling pull_process_and_push_data function for device{“device_id”: “4th Floor”, “ip”: “192.168.56.31”, “punch_direction”: “AUTO”, “clear_from_device_on_fetch”: false}
Traceback (most recent call last):
File “/home/frappe/myfrappe/sites/push-biometric-erpnext/erpnext_sync.py”, line 60, in main
pull_process_and_push_data(device, device_attendance_logs)
File “/home/frappe/myfrappe/sites/push-biometric-erpnext/erpnext_sync.py”, line 138, in pull_process_and_push_data
raise Exception(‘API Call to ERPNext Failed.’)
Exception: API Call to ERPNext Failed.
2023-03-30 02:39:16,427 ERROR Error during ERPNext API Call. 3812 1668675799.0 3rd Floor IN Traceback (most recent call last):
File “apps/frappe/frappe/handler.py”, line 72, in execute_cmd
method = get_attr(cmd)
File “apps/frappe/frappe/handler.py”, line 258, in get_attr
method = frappe.get_attr(cmd)
File “apps/frappe/frappe/init.py”, line 1577, in get_attr
return getattr(get_module(modulename), methodname)
File “apps/frappe/frappe/init.py”, line 1319, 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 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘erpnext.hr.doctype.employee_checkin.employee_checkin’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 69, in application
response = frappe.api.handle()
File “apps/frappe/frappe/api.py”, line 54, in handle
return frappe.handler.handle()
File “apps/frappe/frappe/handler.py”, line 45, in handle
data = execute_cmd(cmd)
File “apps/frappe/frappe/handler.py”, line 74, in execute_cmd
frappe.throw(_(“Failed to get method for command {0} with {1}”).format(cmd, e))
File “apps/frappe/frappe/init.py”, line 522, in throw
msgprint(
File “apps/frappe/frappe/init.py”, line 490, in msgprint
_raise_exception()
File “apps/frappe/frappe/init.py”, line 442, 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.doctype.employee_checkin.employee_checkin’

2023-03-30 02:39:16,428 ERROR exception when calling pull_process_and_push_data function for device{“device_id”: “3rd Floor”, “ip”: “192.168.50.17”, “punch_direction”: “AUTO”, “clear_from_device_on_fetch”: false}
Traceback (most recent call last):
File “/home/frappe/myfrappe/sites/push-biometric-erpnext/erpnext_sync.py”, line 60, in main
pull_process_and_push_data(device, device_attendance_logs)
File “/home/frappe/myfrappe/sites/push-biometric-erpnext/erpnext_sync.py”, line 138, in pull_process_and_push_data
raise Exception(‘API Call to ERPNext Failed.’)
Exception: API Call to ERPNext Failed.
2023-03-30 02:40:16,529 ERROR Error during ERPNext API Call. 1 1666863029.0 4th Floor IN Traceback (most recent call last):
File “apps/frappe/frappe/handler.py”, line 72, in execute_cmd
method = get_attr(cmd)
File “apps/frappe/frappe/handler.py”, line 258, in get_attr
method = frappe.get_attr(cmd)
File “apps/frappe/frappe/init.py”, line 1577, in get_attr
return getattr(get_module(modulename), methodname)
File “apps/frappe/frappe/init.py”, line 1319, 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 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘erpnext.hr.doctype.employee_checkin.employee_checkin’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 69, in application
response = frappe.api.handle()
File “apps/frappe/frappe/api.py”, line 54, in handle
return frappe.handler.handle()
File “apps/frappe/frappe/handler.py”, line 45, in handle
data = execute_cmd(cmd)
File “apps/frappe/frappe/handler.py”, line 74, in execute_cmd
frappe.throw(_(“Failed to get method for command {0} with {1}”).format(cmd, e))
File “apps/frappe/frappe/init.py”, line 522, in throw
msgprint(
File “apps/frappe/frappe/init.py”, line 490, in msgprint
_raise_exception()
File “apps/frappe/frappe/init.py”, line 442, 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.doctype.employee_checkin.employee_checkin’

2023-03-30 02:40:16,530 ERROR exception when calling pull_process_and_push_data function for device{“device_id”: “4th Floor”, “ip”: “192.168.56.31”, “punch_direction”: “AUTO”, “clear_from_device_on_fetch”: false}
Traceback (most recent call last):
File “/home/frappe/myfrappe/sites/push-biometric-erpnext/erpnext_sync.py”, line 60, in main
pull_process_and_push_data(device, device_attendance_logs)
File “/home/frappe/myfrappe/sites/push-biometric-erpnext/erpnext_sync.py”, line 138, in pull_process_and_push_data
raise Exception(‘API Call to ERPNext Failed.’)
Exception: API Call to ERPNext Failed.
2023-03-30 02:40:16,569 ERROR Error during ERPNext API Call. 3812 1668675799.0 3rd Floor IN Traceback (most recent call last):
File “apps/frappe/frappe/handler.py”, line 72, in execute_cmd
method = get_attr(cmd)
File “apps/frappe/frappe/handler.py”, line 258, in get_attr
method = frappe.get_attr(cmd)
File “apps/frappe/frappe/init.py”, line 1577, in get_attr
return getattr(get_module(modulename), methodname)
File “apps/frappe/frappe/init.py”, line 1319, 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 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘erpnext.hr.doctype.employee_checkin.employee_checkin’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 69, in application
response = frappe.api.handle()
File “apps/frappe/frappe/api.py”, line 54, in handle
return frappe.handler.handle()
File “apps/frappe/frappe/handler.py”, line 45, in handle
data = execute_cmd(cmd)
File “apps/frappe/frappe/handler.py”, line 74, in execute_cmd
frappe.throw(_(“Failed to get method for command {0} with {1}”).format(cmd, e))
File “apps/frappe/frappe/init.py”, line 522, in throw
msgprint(
File “apps/frappe/frappe/init.py”, line 490, in msgprint
_raise_exception()
File “apps/frappe/frappe/init.py”, line 442, 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.doctype.employee_checkin.employee_checkin’

2023-03-30 02:40:16,570 ERROR exception when calling pull_process_and_push_data function for device{“device_id”: “3rd Floor”, “ip”: “192.168.50.17”, “punch_direction”: “AUTO”, “clear_from_device_on_fetch”: false}
Traceback (most recent call last):
File “/home/frappe/myfrappe/sites/push-biometric-erpnext/erpnext_sync.py”, line 60, in main
pull_process_and_push_data(device, device_attendance_logs)
File “/home/frappe/myfrappe/sites/push-biometric-erpnext/erpnext_sync.py”, line 138, in pull_process_and_push_data
raise Exception(‘API Call to ERPNext Failed.’)
Exception: API Call to ERPNext Failed.
2023-03-30 02:41:16,702 ERROR Error during ERPNext API Call. 1 1666863029.0 4th Floor IN Traceback (most recent call last):
File “apps/frappe/frappe/handler.py”, line 72, in execute_cmd
method = get_attr(cmd)
File “apps/frappe/frappe/handler.py”, line 258, in get_attr
method = frappe.get_attr(cmd)
File “apps/frappe/frappe/init.py”, line 1577, in get_attr
return getattr(get_module(modulename), methodname)
File “apps/frappe/frappe/init.py”, line 1319, 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 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘erpnext.hr.doctype.employee_checkin.employee_checkin’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 69, in application
response = frappe.api.handle()
File “apps/frappe/frappe/api.py”, line 54, in handle
return frappe.handler.handle()
File “apps/frappe/frappe/handler.py”, line 45, in handle
data = execute_cmd(cmd)
File “apps/frappe/frappe/handler.py”, line 74, in execute_cmd
frappe.throw(_(“Failed to get method for command {0} with {1}”).format(cmd, e))
File “apps/frappe/frappe/init.py”, line 522, in throw
msgprint(
File “apps/frappe/frappe/init.py”, line 490, in msgprint
_raise_exception()
File “apps/frappe/frappe/init.py”, line 442, 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.doctype.employee_checkin.employee_checkin’

2023-03-30 02:41:16,703 ERROR exception when calling pull_process_and_push_data function for device{“device_id”: “4th Floor”, “ip”: “192.168.56.31”, “punch_direction”: “AUTO”, “clear_from_device_on_fetch”: false}
Traceback (most recent call last):
File “/home/frappe/myfrappe/sites/push-biometric-erpnext/erpnext_sync.py”, line 60, in main
pull_process_and_push_data(device, device_attendance_logs)
File “/home/frappe/myfrappe/sites/push-biometric-erpnext/erpnext_sync.py”, line 138, in pull_process_and_push_data
raise Exception(‘API Call to ERPNext Failed.’)
Exception: API Call to ERPNext Failed.
2023-03-30 02:41:16,742 ERROR Error during ERPNext API Call. 3812 1668675799.0 3rd Floor IN Traceback (most recent call last):
File “apps/frappe/frappe/handler.py”, line 72, in execute_cmd
method = get_attr(cmd)
File “apps/frappe/frappe/handler.py”, line 258, in get_attr
method = frappe.get_attr(cmd)
File “apps/frappe/frappe/init.py”, line 1577, in get_attr
return getattr(get_module(modulename), methodname)
File “apps/frappe/frappe/init.py”, line 1319, 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 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘erpnext.hr.doctype.employee_checkin.employee_checkin’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 69, in application
response = frappe.api.handle()
File “apps/frappe/frappe/api.py”, line 54, in handle
return frappe.handler.handle()
File “apps/frappe/frappe/handler.py”, line 45, in handle
data = execute_cmd(cmd)
File “apps/frappe/frappe/handler.py”, line 74, in execute_cmd
frappe.throw(_(“Failed to get method for command {0} with {1}”).format(cmd, e))
File “apps/frappe/frappe/init.py”, line 522, in throw
msgprint(
File “apps/frappe/frappe/init.py”, line 490, in msgprint
_raise_exception()
File “apps/frappe/frappe/init.py”, line 442, 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.doctype.employee_checkin.employee_checkin’

2023-03-30 02:41:16,743 ERROR exception when calling pull_process_and_push_data function for device{“device_id”: “3rd Floor”, “ip”: “192.168.50.17”, “punch_direction”: “AUTO”, “clear_from_device_on_fetch”: false}
Traceback (most recent call last):
File “/home/frappe/myfrappe/sites/push-biometric-erpnext/erpnext_sync.py”, line 60, in main
pull_process_and_push_data(device, device_attendance_logs)
File “/home/frappe/myfrappe/sites/push-biometric-erpnext/erpnext_sync.py”, line 138, in pull_process_and_push_data
raise Exception(‘API Call to ERPNext Failed.’)
Exception: API Call to ERPNext Failed.
2023-03-30 02:42:16,846 ERROR Error during ERPNext API Call. 1 1666863029.0 4th Floor IN Traceback (most recent call last):
File “apps/frappe/frappe/handler.py”, line 72, in execute_cmd
method = get_attr(cmd)
File “apps/frappe/frappe/handler.py”, line 258, in get_attr
method = frappe.get_attr(cmd)
File “apps/frappe/frappe/init.py”, line 1577, in get_attr
return getattr(get_module(modulename), methodname)
File “apps/frappe/frappe/init.py”, line 1319, 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 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘erpnext.hr.doctype.employee_checkin.employee_checkin’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 69, in application
response = frappe.api.handle()
File “apps/frappe/frappe/api.py”, line 54, in handle
return frappe.handler.handle()
File “apps/frappe/frappe/handler.py”, line 45, in handle
data = execute_cmd(cmd)
File “apps/frappe/frappe/handler.py”, line 74, in execute_cmd
frappe.throw(_(“Failed to get method for command {0} with {1}”).format(cmd, e))
File “apps/frappe/frappe/init.py”, line 522, in throw
msgprint(
File “apps/frappe/frappe/init.py”, line 490, in msgprint
_raise_exception()
File “apps/frappe/frappe/init.py”, line 442, 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.doctype.employee_checkin.employee_checkin’

2023-03-30 02:42:16,847 ERROR exception when calling pull_process_and_push_data function for device{“device_id”: “4th Floor”, “ip”: “192.168.56.31”, “punch_direction”: “AUTO”, “clear_from_device_on_fetch”: false}
Traceback (most recent call last):
File “/home/frappe/myfrappe/sites/push-biometric-erpnext/erpnext_sync.py”, line 60, in main
pull_process_and_push_data(device, device_attendance_logs)
File “/home/frappe/myfrappe/sites/push-biometric-erpnext/erpnext_sync.py”, line 138, in pull_process_and_push_data
raise Exception(‘API Call to ERPNext Failed.’)
Exception: API Call to ERPNext Failed.
2023-03-30 02:42:16,887 ERROR Error during ERPNext API Call. 3812 1668675799.0 3rd Floor IN Traceback (most recent call last):
File “apps/frappe/frappe/handler.py”, line 72, in execute_cmd
method = get_attr(cmd)
File “apps/frappe/frappe/handler.py”, line 258, in get_attr
method = frappe.get_attr(cmd)
File “apps/frappe/frappe/init.py”, line 1577, in get_attr
return getattr(get_module(modulename), methodname)
File “apps/frappe/frappe/init.py”, line 1319, 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 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘erpnext.hr.doctype.employee_checkin.employee_checkin’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 69, in application
response = frappe.api.handle()
File “apps/frappe/frappe/api.py”, line 54, in handle
return frappe.handler.handle()
File “apps/frappe/frappe/handler.py”, line 45, in handle
data = execute_cmd(cmd)
File “apps/frappe/frappe/handler.py”, line 74, in execute_cmd
frappe.throw(_(“Failed to get method for command {0} with {1}”).format(cmd, e))
File “apps/frappe/frappe/init.py”, line 522, in throw
msgprint(
File “apps/frappe/frappe/init.py”, line 490, in msgprint
_raise_exception()
File “apps/frappe/frappe/init.py”, line 442, 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.doctype.employee_checkin.employee_checkin’

2023-03-30 02:42:16,888 ERROR exception when calling pull_process_and_push_data function for device{“device_id”: “3rd Floor”, “ip”: “192.168.50.17”, “punch_direction”: “AUTO”, “clear_from_device_on_fetch”: false}
Traceback (most recent call last):
File “/home/frappe/myfrappe/sites/push-biometric-erpnext/erpnext_sync.py”, line 60, in main
pull_process_and_push_data(device, device_attendance_logs)
File “/home/frappe/myfrappe/sites/push-biometric-erpnext/erpnext_sync.py”, line 138, in pull_process_and_push_data
raise Exception(‘API Call to ERPNext Failed.’)
Exception: API Call to ERPNext Failed.

What I have done is, I have intentionally changed the API Secret and run the script. It raised the same error. I am confused. I have generated the Secret for Administrator user and that copied and pasted in the script; moreover, to check please also see the screenshot.

Here lies your issue. migrating to version 14 changes that endpoint to ‘hrms.hr.doctype.employee_checkin.employee_checkin’ since HR module is now a separate app.

You need to make sure you have the latest update of the biometric sync tool. Go to the tool directory and git pull if you haven’t done that and you will also need to make a minor change to your local_config.py. Once you pull, change the ERPNext version under the key to 14 (the default will be 13) and then stop and restart the tool to use the new changes.

Hope this helps

Many thanks for pointing me to the right direction. I just changed erpnext to hrms in the erpnext_sync.py file.

I changed from

url = config.ERPNEXT_URL + “/api/method/erpnext.hr.doctype.employee_checkin.employee_checkin.add_log_based_on_employee_field”

to

url = config.ERPNEXT_URL + “/api/method/hrms.hr.doctype.employee_checkin.employee_checkin.add_log_based_on_employee_field”

And it is working fine now.
Many thanks.

I think you should pull the update instead as this guarantees you will have the most updated functions.

I think I am missing something here.
the git has release of 2020, not above that.

is there anything else?

Update: I have manually downloaded the latest files.

Thanks a lot for your perfect video. When I run the file “erpnext_sync.py” as https://youtu.be/KhfncWCcu68?t=277 It shows Service Running" only and didnt show any data behind “Service Dunning” and also without any change at ERPNext.