Skip to content

Commit

Permalink
Merge pull request #2316 from frappe/mergify/bp/version-15/pr-2303
Browse files Browse the repository at this point in the history
fix(Employee Checkin): Fetch Geolocation (backport #2303)
  • Loading branch information
krantheman authored Oct 21, 2024
2 parents 37fb469 + 1de53e2 commit 30768b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion hrms/hr/doctype/employee_checkin/employee_checkin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -43,6 +43,10 @@ def validate_duplicate_log(self):
_("This employee already has a log with the same timestamp.{0}").format("<Br>" + doc_link)
)

@frappe.whitelist()
def set_geolocation(self):
set_geolocation_from_coordinates(self)

@frappe.whitelist()
def fetch_shift(self):
if not (
Expand Down
2 changes: 1 addition & 1 deletion hrms/public/js/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 30768b0

Please sign in to comment.