Merge pull request #16492 from rohitwaghchaure/ascii_code_issue_pos_offline_not_working

fix: ascii codec while opening offline POS
This commit is contained in:
Nabin Hait 2019-01-25 09:50:41 +05:30 committed by GitHub
commit 393080ecbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: