Make one whitelist function in erpnext that accept data from your bio-metric device. When punch in-out one API call trigger from device that call this whitelist function and in whitelist function you can write your logic.
Make one API function your bio-metric side where you pass date and get all attendance information of that date or you can set one scheduler that call everyday and put attandance information in erp.
Can anyone share a working whitelist script sample? Would really appreciate it. I have a Hikvision Access Control system and i would love to integrate it to the biometric attendance module but i am kinda lost as to how to create the whitelist. I checked the article above but it didn’t help a noob like me.
@flexy2ky as far as bio-metric integration goes, you might not have to create a new whitelisted function. This already exists in the “Employee Checkin” DocType.
The function is called “add_log_based_on_employee_field”.
This function can be accessed via the URL: /api/method/erpnext.hr.doctype.employee_checkin.employee_checkin.add_log_based_on_employee_field
@Maheshwari_Bhavesh, please note that the whitelisted function that you are recommending to write already exists. Also, ERPNext now handles the part of converting the IN/OUT time logs to attendance. Please refer to the Auto Attendance feature for the same.
@IT_Design, this script needs to be installed in any of the computer that has IP Network access to your bio-metric device(i.e most probably on a machine that is on the same LAN network as your bio-metric device).
ile “push_to_erpnext.py”, line 42
def pull_process_and_push_data(device, device_attendance_logs=None):
^
This is te error which is coming to me when i am running " push_to_erpnext.py"
Dear @karthikeyan5 thanks very much for sharing the script. I have one issue when running the script which is frappe.throw(_("No Employee found for the given employee field value. '{}': {}").format(employee_fieldname,employee_field_value))
@Riyas_Rawther, I hope you have already solved this issue…
Anyways here is what seems to be wrong with your setup:
You seem to have not set the Attendance device ID in the Employee document.
To fix this do the following:
goto “Employee” > “ATTENDANCE AND LEAVE DETAILS” > “Attendance Device ID (Biometric/RF tag ID)” field… and set the ID from your biometric device for that employee…
BTW, thanks for sharing some additional steps to follow for the community.
You can create duplicate files and run them separately. I think you need to do that for multiple machines too because i found the machine port is hard coded.