“erpnext”: “13.36.2”,
“frappe”: “13.36.3”
Route
Form/Sales Invoice/new-sales-invoice-1
Trackeback
Syntax error in query:
select `tabDelivery Note`.name, `tabDelivery Note`.title, `tabDelivery Note`.customer, `tabDelivery Note`.posting_date, `tabDelivery Note`.status, `tabDelivery Note`.customer_name, `tabDelivery Note`.territory, `tabDelivery Note`.base_grand_total
from `tabDelivery Note`
where `tabDelivery Note`.`name` like %(txt)s and
`tabDelivery Note`.docstatus = 1
and status not in ("Stopped", "Closed") and `tabDelivery Note`.`docstatus` = 1.0 and `tabDelivery Note`.`company` = 'my company' and `tabDelivery Note`.`is_return` = 0.0 and `tabDelivery Note`.`customer` = 'my customer' and `tabDelivery Note Item`.`item_code` = ['is', 'set']
and (
(`tabDelivery Note`.is_return = 0 and `tabDelivery Note`.per_billed < 100)
or (`tabDelivery Note`.grand_total = 0 and `tabDelivery Note`.per_billed < 100)
or (
`tabDelivery Note`.is_return = 1
and return_against in (select name from `tabDelivery Note` where per_billed < 100)
)
)
order by `tabDelivery Note`.`name` asc limit 0, 25
Traceback (most recent call last):
File "apps/frappe/frappe/app.py", line 69, in application
response = frappe.api.handle()
File "apps/frappe/frappe/api.py", line 55, in handle
return frappe.handler.handle()
File "apps/frappe/frappe/handler.py", line 38, in handle
data = execute_cmd(cmd)
File "apps/frappe/frappe/handler.py", line 76, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "apps/frappe/frappe/__init__.py", line 1457, in call
return fn(*args, **newargs)
File "apps/frappe/frappe/desk/search.py", line 126, in search_widget
raise e
File "apps/frappe/frappe/desk/search.py", line 114, in search_widget
frappe.response["values"] = frappe.call(
File "apps/frappe/frappe/__init__.py", line 1457, in call
return fn(*args, **newargs)
File "apps/frappe/frappe/desk/search.py", line 294, in validate_and_sanitize_search_inputs
return fn(**kwargs)
File "apps/erpnext/erpnext/controllers/queries.py", line 371, in get_delivery_notes_to_be_billed
return frappe.db.sql(
File "apps/frappe/frappe/database/database.py", line 174, in sql
self._cursor.execute(query, values)
File "env/lib/python3.8/site-packages/pymysql/cursors.py", line 148, in execute
result = self._query(query)
File "env/lib/python3.8/site-packages/pymysql/cursors.py", line 310, in _query
conn.query(q)
File "env/lib/python3.8/site-packages/pymysql/connections.py", line 548, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "env/lib/python3.8/site-packages/pymysql/connections.py", line 775, in _read_query_result
result.read()
File "env/lib/python3.8/site-packages/pymysql/connections.py", line 1156, in read
first_packet = self.connection._read_packet()
File "env/lib/python3.8/site-packages/pymysql/connections.py", line 725, in _read_packet
packet.raise_for_error()
File "env/lib/python3.8/site-packages/pymysql/protocol.py", line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File "env/lib/python3.8/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '['is', 'set']\n\t\t\tand (\n\t\t\t\t(`tabDelivery Note`.is_return = 0 and `tabDelivery...' at line 5")
Request Data
{
"type": "GET",
"args": {
"doctype": "Delivery Note",
"txt": "",
"filters": "{\"docstatus\":1,\"company\":\"my company\",\"is_return\":0,\"customer\":\"my customer\",\"item_code\":[\"is\",\"set\"]}",
"filter_fields": "[\"customer\"]",
"page_length": 25,
"query": "erpnext.controllers.queries.get_delivery_notes_to_be_billed",
"as_dict": 1
},
"headers": {},
"error_handlers": {},
"url": "/api/method/frappe.desk.search.search_widget"
}
Response Data
{
"exception": "pymysql.err.ProgrammingError: (1064, \"You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '['is', 'set']\\n\\t\\t\\tand (\\n\\t\\t\\t\\t(`tabDelivery Note`.is_return = 0 and `tabDelivery...' at line 5\")"
}