diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index 08ef1bcac9..86cb099f92 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -75,7 +75,8 @@ class DocType: def validate_item(self, item, count): """ Validate item exists and non-serialized""" - det = sql("select item_code, has_serial_no from `tabItem` where name = '%s'"% cstr(item), as_dict = 1) + det = sql("select item_code, has_serial_no from `tabItem` \ + where name = %s", cstr(item), as_dict = 1) if not det: msgprint("Item: " + cstr(item) + " mentioned at Row No. " + cstr(count) + "does not exist in the system") self.validated = 0 @@ -88,7 +89,7 @@ class DocType: def validate_warehouse(self, wh, count,): """Validate warehouse exists""" - if not sql("select name from `tabWarehouse` where name = '%s'" % cstr(wh)): + if not sql("select name from `tabWarehouse` where name = %s", cstr(wh)): msgprint("Warehouse: " + cstr(wh) + " mentioned at Row No. " + cstr(count) + " does not exist in the system") self.validated = 0