fix: escaped warehouse value for sql query (bp #26049)

Co-authored-by: Noah Jacob <noahjacobkurian@gmail.com>
This commit is contained in:
Ankush 2021-06-18 14:47:30 +05:30 committed by GitHub
parent e43df63978
commit 584fe32900
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -558,11 +558,8 @@ def future_sle_exists(args):
or_conditions = []
for warehouse, items in warehouse_items_map.items():
or_conditions.append(
"warehouse = '{}' and item_code in ({})".format(
warehouse,
", ".join(frappe.db.escape(item) for item in items)
)
)
f"""warehouse = {frappe.db.escape(warehouse)}
and item_code in ({', '.join(frappe.db.escape(item) for item in items)})""")
return frappe.db.sql("""
select name