Merge branch 'master' of github.com:webnotes/erpnext

This commit is contained in:
Nabin Hait 2012-03-28 11:32:58 +05:30
commit df77a1f619

View File

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