From ec2a2ac47e655261a42cb80c73188e42f53c164c Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 12 Jun 2018 01:16:28 +0530 Subject: [PATCH] [Fix] patch --- erpnext/patches/v11_0/update_total_qty_field.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/erpnext/patches/v11_0/update_total_qty_field.py b/erpnext/patches/v11_0/update_total_qty_field.py index 6f78d8a77f..c5d27d25d0 100644 --- a/erpnext/patches/v11_0/update_total_qty_field.py +++ b/erpnext/patches/v11_0/update_total_qty_field.py @@ -28,7 +28,8 @@ def execute(): when dt.name = '{0}' then {1} """.format(frappe.db.escape(d.get("parent")), d.get("qty"))) - frappe.db.sql(''' - UPDATE - `tab%s` dt SET dt.total_qty = CASE %s END - ''' % (doctype, " ".join(when_then))) \ No newline at end of file + if when_then: + frappe.db.sql(''' + UPDATE + `tab%s` dt SET dt.total_qty = CASE %s END + ''' % (doctype, " ".join(when_then))) \ No newline at end of file