[Fix] Patch broken if serial no has single quote (#10262)

This commit is contained in:
rohitwaghchaure 2017-08-03 17:38:03 +05:30 committed by Makarand Bauskar
parent ee5ff805e9
commit 046e1a6e28

View File

@ -26,7 +26,7 @@ def execute():
if not sales_invoice or not serial_nos:
continue
serial_nos = ["'%s'"%no for no in serial_nos.split("\n")]
serial_nos = ["'%s'"%frappe.db.escape(no) for no in serial_nos.split("\n")]
frappe.db.sql("""
UPDATE
@ -36,7 +36,7 @@ def execute():
WHERE
name in ({serial_nos})
""".format(
sales_invoice=sales_invoice,
sales_invoice=frappe.db.escape(sales_invoice),
serial_nos=",".join(serial_nos)
)
)