fix: use percent string templates for db.sql calls

This commit is contained in:
18alantom 2021-05-03 19:49:22 +05:30 committed by Ankush Menat
parent ca37380d2e
commit e36f303042

View File

@ -935,8 +935,8 @@ def get_bin_details(item_code, warehouse, company=None):
def get_company_total_stock(item_code, company):
return frappe.db.sql("""SELECT sum(actual_qty) from
(`tabBin` INNER JOIN `tabWarehouse` ON `tabBin`.warehouse = `tabWarehouse`.name)
WHERE `tabWarehouse`.company = '{0}' and `tabBin`.item_code = '{1}'"""
.format(company, item_code))[0][0]
WHERE `tabWarehouse`.company = %s and `tabBin`.item_code = %s""",
(company, item_code))[0][0]
@frappe.whitelist()
def get_serial_no_details(item_code, warehouse, stock_qty, serial_no):