[fix] Stock Ledger report item filter

- breaks when Item Code contains % symbol
This commit is contained in:
Faris Ansari 2018-05-17 12:18:28 +05:30
parent b81ece9ddf
commit 9e4889d756

View File

@ -56,7 +56,7 @@ def get_stock_ledger_entries(filters, items):
item_conditions_sql = ''
if items:
item_conditions_sql = 'and sle.item_code in ({})'\
.format(', '.join(['"' + frappe.db.escape(i,percent=False) + '"' for i in items]))
.format(', '.join(['"' + frappe.db.escape(i) + '"' for i in items]))
return frappe.db.sql("""select concat_ws(" ", posting_date, posting_time) as date,
item_code, warehouse, actual_qty, qty_after_transaction, incoming_rate, valuation_rate,