I’m facing an error while generating the leave application report. Here is the issue below:
App Versions
{
"crm": "2.0.0-dev",
"demoapp": "0.0.1",
"employee_self_service": "2.2.2",
"erpnext": "15.82.1",
"frappe": "15.85.0",
"frappe_s3_attachment": "0.0.1",
"hrms": "15.50.3",
"india_compliance": "15.23.0",
"insights": "3.2.11",
"library_management": "0.0.1",
"payments": "0.0.1",
"zubera": "0.0.1"
}
Route
query-report/Daily Leave Application Report
Traceback
Traceback (most recent call last):
File "apps/frappe/frappe/app.py", line 115, in application
response = frappe.api.handle(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/api/__init__.py", line 50, 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 52, 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 1754, in call
return fn(*args, **newargs)
^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/utils/typing_validations.py", line 32, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/__init__.py", line 891, in wrapper_fn
retval = fn(*args, **get_newargs(fn, kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/desk/query_report.py", line 229, in run
result = generate_report_result(report, filters, user, custom_columns, is_tree, parent_field)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/__init__.py", line 891, in wrapper_fn
retval = fn(*args, **get_newargs(fn, kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/desk/query_report.py", line 85, in generate_report_result
res = get_report_result(report, filters) or []
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/desk/query_report.py", line 66, in get_report_result
res = report.execute_script_report(filters)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/core/doctype/report/report.py", line 174, in execute_script_report
res = self.execute_module(filters)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/core/doctype/report/report.py", line 190, in execute_module
return frappe.get_attr(method_name)(frappe._dict(filters))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/library_management/library_management/library_management/report/daily_leave_application_report/daily_leave_application_report.py", line 11, in execute
data = get_data(filters)
^^^^^^^^^^^^^^^^^
File "apps/library_management/library_management/library_management/report/daily_leave_application_report/daily_leave_application_report.py", line 61, in get_data
attendance_reqs = frappe.get_list(
^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/__init__.py", line 2022, in get_list
return frappe.model.db_query.DatabaseQuery(doctype).execute(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/model/db_query.py", line 191, in execute
result = self.build_and_run()
^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/model/db_query.py", line 232, in build_and_run
return frappe.db.sql(
^^^^^^^^^^^^^^
File "apps/frappe/frappe/database/database.py", line 230, in sql
self._cursor.execute(query, values)
File "env/lib/python3.12/site-packages/pymysql/cursors.py", line 153, in execute
result = self._query(query)
^^^^^^^^^^^^^^^^^^
File "env/lib/python3.12/site-packages/pymysql/cursors.py", line 322, in _query
conn.query(q)
File "env/lib/python3.12/site-packages/pymysql/connections.py", line 563, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "env/lib/python3.12/site-packages/pymysql/connections.py", line 825, in _read_query_result
result.read()
File "env/lib/python3.12/site-packages/pymysql/connections.py", line 1199, in read
first_packet = self.connection._read_packet()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "env/lib/python3.12/site-packages/pymysql/connections.py", line 775, in _read_packet
packet.raise_for_error()
File "env/lib/python3.12/site-packages/pymysql/protocol.py", line 219, in raise_for_error
err.raise_mysql_exception(self._data)
File "env/lib/python3.12/site-packages/pymysql/err.py", line 150, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (1054, "Unknown column 'tabAttendance Request.comp' in 'WHERE'")
Request Data
{
"type": "GET",
"args": {
"report_name": "Daily Leave Application Report",
"filters": "{\"from_date\":\"2025-10-16\",\"to_date\":\"2025-10-16\",\"company\":\"Jawahar Private Limited\"}",
"ignore_prepared_report": false,
"are_default_filters": true
},
"headers": {},
"error_handlers": {},
"url": "/api/method/frappe.desk.query_report.run",
"request_id": null
}
Response Data
{
"exception": "pymysql.err.OperationalError: (1054, \"Unknown column 'tabAttendance Request.comp' in 'WHERE'\")",
"exc_type": "OperationalError",
"_exc_source": "library_management (app)"
}
My conditions for leave application are that the Employee wants to submit either a leave application request or an attendance request within the range between the current date. If employee does not apply both the leave application request and attendance request reports, we want to show NA for the employee. Finally, the reports should display the employee’s name. Attendance Status (Present or Absent) and Leave Application Status(Approved or Rejected), Attendance Date, and Leave Date.



