fix: ascii code while opening offline POS

This commit is contained in:
Rohit Waghchaure 2019-01-24 23:59:00 +05:30
parent 7e4cf62a15
commit 74df01d3d1

View File

@ -333,10 +333,12 @@ def get_bin_data(pos_profile):
itemwise_bin_data = {} itemwise_bin_data = {}
cond = "1=1" cond = "1=1"
if pos_profile.get('warehouse'): 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` 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: for bins in bin_data:
if bins.item_code not in itemwise_bin_data: if bins.item_code not in itemwise_bin_data: