8848digital / hrms

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

Server Error while opening connections tab in employee doctype #9

Closed balamurugan8848 closed 1 week ago

balamurugan8848 commented 2 weeks ago

Information about bug

In the employee doctype when clicked on the connections tab I get the below error

Image

Module

HR

Version

Frappe HR: v15.36.1 (pre-prod) ERPNext: v15.50.0 (pre-prod) Frappe Framework: v15.52.0 (pre-prod)

Installation method

None

Relevant log output / Stack trace / Full Error Message.

### App Versions

{
    "assets": "0.0.1",
    "crm": "2.0.0-dev",
    "custom_crm": "0.0.1",
    "erpnext": "15.50.0",
    "erpnext_india": "0.0.1",
    "exotel_integration": "0.0.1",
    "frappe": "15.52.0",
    "helpdesk": "1.4.0",
    "hr_addon": "0.0.1",
    "hrms": "15.36.1",
    "india_compliance": "15.15.0",
    "insights": "3.0.0",
    "payments": "0.0.1",
    "print_designer": "1.4.3",
    "projects": "0.0.1",
    "sales_commission": "0.0.1",
    "transportation": "0.0.1"
}

### Route

Form/Employee/HR-EMP-00002

### 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 50, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 86, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1758, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
  File "apps/hrms/hrms/overrides/employee_master.py", line 119, in get_timeline_data
    frappe.db.sql(
  File "apps/frappe/frappe/database/postgres/database.py", line 326, in sql
    return super().sql(modify_query(query), modify_values(values), *args, **kwargs)
  File "apps/frappe/frappe/database/database.py", line 236, in sql
    self._cursor.execute(query, values)
psycopg2.errors.SyntaxError: syntax error at or near "1"
LINE 3: ...  and attendance_date > date_sub(curdate(), interval 1 year)
                                                                ^

### Request Data

{
    "type": "GET",
    "args": {
        "doctype": "Employee",
        "name": "HR-EMP-00002",
        "items": "[\"Attendance\",\"Attendance Request\",\"Employee Checkin\",\"Leave Application\",\"Leave Allocation\",\"Leave Policy Assignment\",\"Employee Onboarding\",\"Employee Transfer\",\"Employee Promotion\",\"Employee Grievance\",\"Employee Separation\",\"Exit Interview\",\"Full and Final Statement\",\"Salary Withholding\",\"Shift Request\",\"Shift Assignment\",\"Expense Claim\",\"Travel Request\",\"Employee Advance\",\"Employee Benefit Application\",\"Employee Benefit Claim\",\"Salary Structure Assignment\",\"Salary Slip\",\"Additional Salary\",\"Timesheet\",\"Employee Incentive\",\"Retention Bonus\",\"Bank Account\",\"Training Event\",\"Training Result\",\"Training Feedback\",\"Employee Skill Map\",\"Appraisal\"]"
    },
    "headers": {},
    "error_handlers": {},
    "url": "/api/method/hrms.overrides.employee_master.get_timeline_data",
    "request_id": null
}

### Response Data

{
    "exception": "",
    "exc_type": "SyntaxError",
    "_exc_source": "hrms (app)",
    "_debug_messages": "[\"Syntax error in query:\\nselect unix_timestamp(attendance_date), count(*)\\n\\t\\t\\tfrom \\\"tabAttendance\\\" where employee=%s\\n\\t\\t\\tand attendance_date > date_sub(curdate(), interval 1 year)\\n\\t\\t\\tand status in ('Present', 'Half Day')\\n\\t\\t\\tgroup by attendance_date ('HR-EMP-00002',)\"]"
}
balamurugan8848 commented 2 weeks ago

@hrishikesh8848 @Satya8848

hrishikesh8848 commented 1 week ago

@balamurugan8848 this is fixed

balamurugan8848 commented 1 week ago

@hrishikesh8848 this is working fine. Closing this issue.