I have created a custom app and now I am trying to make report in it. The report is working fine in my development environment. How ever when I deploy it in the production server it is giving me error. I have tried to change the code directly in the production server just to see. But it keeps showing the same error on the same line no mater how I change the code, I have even tried to change the file name just to see what happens. The code has been taken and customized from stock ledger report
The code is on this link: Code for report
below is the error:
Traceback (most recent call last):
File “/home/ahmad/frappe-bench/apps/frappe/frappe/app.py”, line 60, in application
response = frappe.api.handle()
File “/home/ahmad/frappe-bench/apps/frappe/frappe/api.py”, line 55, in handle
return frappe.handler.handle()
File “/home/ahmad/frappe-bench/apps/frappe/frappe/handler.py”, line 22, in handle
data = execute_cmd(cmd)
File “/home/ahmad/frappe-bench/apps/frappe/frappe/handler.py”, line 61, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/ahmad/frappe-bench/apps/frappe/frappe/init.py”, line 1042, in call
return fn(*args, **newargs)
File “/home/ahmad/frappe-bench/apps/frappe/frappe/init.py”, line 515, in wrapper_fn
retval = fn(*args, **get_newargs(fn, kwargs))
File “/home/ahmad/frappe-bench/apps/frappe/frappe/desk/query_report.py”, line 183, in run
result = generate_report_result(report, filters, user)
File “/home/ahmad/frappe-bench/apps/frappe/frappe/desk/query_report.py”, line 68, in generate_report_result
res = report.execute_script_report(filters)
File “/home/ahmad/frappe-bench/apps/frappe/frappe/core/doctype/report/report.py”, line 104, in execute_script_report
res = self.execute_module(filters)
File “/home/ahmad/frappe-bench/apps/frappe/frappe/core/doctype/report/report.py”, line 121, in execute_module
return frappe.get_attr(method_name)(frappe._dict(filters))
File “/home/ahmad/frappe-bench/apps/steelpipes/steelpipes/sp_item/report/pipe_stock_ledger/pipe_stock_ledger.py”, line 41, in execute
query_result = frappe.db.sql(sql_query,as_dict=1)
File “/home/ahmad/frappe-bench/apps/frappe/frappe/database/database.py”, line 171, in sql
self._cursor.execute(query)
File “/home/ahmad/frappe-bench/env/lib/python3.5/site-packages/pymysql/cursors.py”, line 170, in execute
result = self._query(query)
File “/home/ahmad/frappe-bench/env/lib/python3.5/site-packages/pymysql/cursors.py”, line 328, in _query
conn.query(q)
File “/home/ahmad/frappe-bench/env/lib/python3.5/site-packages/pymysql/connections.py”, line 517, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/home/ahmad/frappe-bench/env/lib/python3.5/site-packages/pymysql/connections.py”, line 732, in _read_query_result
result.read()
File “/home/ahmad/frappe-bench/env/lib/python3.5/site-packages/pymysql/connections.py”, line 1075, in read
first_packet = self.connection._read_packet()
File “/home/ahmad/frappe-bench/env/lib/python3.5/site-packages/pymysql/connections.py”, line 684, in _read_packet
packet.check_error()
File “/home/ahmad/frappe-bench/env/lib/python3.5/site-packages/pymysql/protocol.py”, line 220, in check_error
err.raise_mysql_exception(self._data)
File “/home/ahmad/frappe-bench/env/lib/python3.5/site-packages/pymysql/err.py”, line 109, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.InternalError: (1054, “Unknown column ‘warehouse’ in ‘where clause’”)