IP Based Restriction only for Checkin and Checkout

Hi @Jignasa_Chavda:

Is far I know there is no option “out of the box” … but …

  1. Customize your employee docytpe. Add a field, named “allowed_checkin_ip”.

  2. Create a server script for your “Employee CheckIn” doctype, event type for “Before insert”

if frappe.request.headers.get('X-Forwarded-For'):
    ip_address = frappe.request.headers.get('X-Forwarded-For').split(',')[0]
else:
    ip_address = frappe.request.remote_addr

allowed_ip = frappe.db.get_value("Employee", doc.employee, "custom_allowed_checkin_ip")

if ip_address != allowed_ip:
    frappe.throw("IP address not allowed")

Hope this helps.