From 74df01d3d10bfeb89b6605602a11fd8826c47b71 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 24 Jan 2019 23:59:00 +0530 Subject: [PATCH] fix: ascii code while opening offline POS --- erpnext/accounts/doctype/sales_invoice/pos.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py index 287da08ef5..1ef7b5403c 100755 --- a/erpnext/accounts/doctype/sales_invoice/pos.py +++ b/erpnext/accounts/doctype/sales_invoice/pos.py @@ -333,10 +333,12 @@ def get_bin_data(pos_profile): itemwise_bin_data = {} cond = "1=1" if pos_profile.get('warehouse'): - cond = "warehouse = '{0}'".format(pos_profile.get('warehouse')) + cond = "warehouse = %(warehouse)s" bin_data = frappe.db.sql(""" select item_code, warehouse, actual_qty from `tabBin` - where actual_qty > 0 and {cond}""".format(cond=cond), as_dict=1) + where actual_qty > 0 and {cond}""".format(cond=cond), { + 'warehouse': frappe.db.escape(pos_profile.get('warehouse')) + }, as_dict=1) for bins in bin_data: if bins.item_code not in itemwise_bin_data: