From f41657ccd1a2a467d116e72775bd97011d38f297 Mon Sep 17 00:00:00 2001 From: krantheman Date: Fri, 18 Oct 2024 15:05:21 +0530 Subject: [PATCH] fix(Employee Checkin): fetch geolocation --- hrms/hr/doctype/employee_checkin/employee_checkin.py | 6 +++++- hrms/public/js/utils/index.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hrms/hr/doctype/employee_checkin/employee_checkin.py b/hrms/hr/doctype/employee_checkin/employee_checkin.py index 9f2808f6d8..ec3792dd1a 100644 --- a/hrms/hr/doctype/employee_checkin/employee_checkin.py +++ b/hrms/hr/doctype/employee_checkin/employee_checkin.py @@ -24,7 +24,7 @@ def validate(self): validate_active_employee(self.employee) self.validate_duplicate_log() self.fetch_shift() - set_geolocation_from_coordinates(self) + self.set_geolocation() self.validate_distance_from_shift_location() def validate_duplicate_log(self): @@ -43,6 +43,10 @@ def validate_duplicate_log(self): _("This employee already has a log with the same timestamp.{0}").format("
" + doc_link) ) + @frappe.whitelist() + def set_geolocation(self): + set_geolocation_from_coordinates(self) + @frappe.whitelist() def fetch_shift(self): if not ( diff --git a/hrms/public/js/utils/index.js b/hrms/public/js/utils/index.js index e8aacff1c2..b13082b8db 100644 --- a/hrms/public/js/utils/index.js +++ b/hrms/public/js/utils/index.js @@ -197,7 +197,7 @@ $.extend(hrms, { frm.set_value("latitude", position.coords.latitude); frm.set_value("longitude", position.coords.longitude); - await frm.call("hrms.hr.utils.set_geolocation_from_coordinates"); + await frm.call("set_geolocation"); frappe.dom.unfreeze(); }, (error) => {