Validate_distance_from_shift_location error in hrms

Hello for all…
Anyone know what does this error mean

AttributeError: ‘EmployeeCheckin’ object has no attribute ‘validate_distance_from_shift_location’
Possible source of error: hrms (app)

App Versions

{
	"business_theme_v14": "0.0.1",
	"erpnext": "15.41.1",
	"erpnext_arabic_layout": "0.0.1",
	"frappe": "15.47.1",
	"hrms": "15.33.2",
	"insights": "3.0.0",
	"print_designer": "1.0.0-dev",
	"raven": "2.0.0"
}

Route

Form/Employee Checkin/new-employee-checkin-drvusebwen

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 114, in application
    response = frappe.api.handle(request)
  File "apps/frappe/frappe/api/__init__.py", line 49, in handle
    data = endpoint(**arguments)
  File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 49, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1781, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
  File "apps/frappe/frappe/desk/form/save.py", line 39, in savedocs
    doc.save()
  File "apps/frappe/frappe/model/document.py", line 337, in save
    return self._save(*args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 359, in _save
    return self.insert()
  File "apps/frappe/frappe/model/document.py", line 291, in insert
    self.run_before_save_methods()
  File "apps/frappe/frappe/model/document.py", line 1091, in run_before_save_methods
    self.run_method("validate")
  File "apps/frappe/frappe/model/document.py", line 962, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1322, in composer
    return composed(self, method, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1304, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "apps/frappe/frappe/model/document.py", line 959, in fn
    return method_object(*args, **kwargs)
  File "apps/hrms/hrms/hr/doctype/employee_checkin/employee_checkin.py", line 28, in validate
    self.validate_distance_from_shift_location()
AttributeError: 'EmployeeCheckin' object has no attribute 'validate_distance_from_shift_location'

Response Data

{
	"exception": "AttributeError: 'EmployeeCheckin' object has no attribute 'validate_distance_from_shift_location'",
	"exc_type": "AttributeError",
	"_exc_source": "hrms (app)"
}

Check in your code if this method is available.

@ejaaz
Yes it is threre…

Okay, then try updating your app. :thinking:

@ejaaz in employee check-in section I coudn’t get the location do you have the same thing…?
I remember that I get a map here when I open it.

map like that


Have you enabled geolocation tracking in HR settings?

1 Like

@ejaaz
ok Now I have the map but still the same error ‘validate_distance_from_shift_location’

Have you tried updating your app?

1 Like

@ejaaz
Kind regards Mr.ejaaz.