frappe / hrms

Open Source HR and Payroll Software
https://frappe.io/hr
GNU General Public License v3.0
1.39k stars 729 forks source link

AttributeError: 'ShiftLocation' object has no attribute 'hrms.hr.utils.set_geolocation_from_coordinates' #2315

Closed dsatsangi closed 3 weeks ago

dsatsangi commented 4 weeks ago

Information about bug

Facing issue since last update 15.32.0 with new feature to set shift location for employee checkin. fetch-location button is returning error and site becomes unresponsive.

Module

HR

Version

"erpnext": "15.38.4", "frappe": "15.44.2", "hrms": "15.32.0", "india_compliance": "15.13.4", "lending": "0.0.1", "lms": "2.8.0", "raven": "2.0.0"

Installation method

FrappeCloud

Relevant log output / Stack trace / Full Error Message.

### App Versions

{
    "erpnext": "15.38.4",
    "frappe": "15.44.2",
    "hrms": "15.32.0",
    "india_compliance": "15.13.4",
    "lending": "0.0.1",
    "lms": "2.8.0",
    "raven": "2.0.0"
}

Route

Form/Shift Location/Office

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 1775, in call
    return fn(*args, **newargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 322, in run_doc_method
    method_obj = getattr(doc, method)
                 ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ShiftLocation' object has no attribute 'hrms.hr.utils.set_geolocation_from_coordinates'

Request Data

{
    "type": "POST",
    "args": {
        "docs": "{\"name\":\"Office\",\"owner\":\"admin@genisup.com\",\"creation\":\"2024-10-19 12:10:45.268817\",\"modified\":\"2024-10-19 12:10:45.268817\",\"modified_by\":\"admin@genisup.com\",\"docstatus\":0,\"idx\":0,\"location_name\":\"Office\",\"checkin_radius\":0,\"latitude\":13.0652053,\"longitude\":77.6270004,\"doctype\":\"Shift Location\",\"__last_sync_on\":\"2024-10-21T05:10:54.040Z\"}",
        "method": "hrms.hr.utils.set_geolocation_from_coordinates"
    },
    "headers": {},
    "error_handlers": {},
    "url": "/api/method/run_doc_method",
    "request_id": "11b8b6a1-731e-470b-bb63-2c2f80590fae"
}

Response Data

{
    "exception": "AttributeError: 'ShiftLocation' object has no attribute 'hrms.hr.utils.set_geolocation_from_coordinates'",
    "exc_type": "AttributeError"
}


### Code of Conduct

- [X] I agree to follow this project's Code of Conduct
dsatsangi commented 4 weeks ago

@ruchamahabal

krantheman commented 3 weeks ago

Fixed with https://github.com/frappe/hrms/pull/2303