From 41cb6cc491e7dd5df79e15c33b820549fde352d4 Mon Sep 17 00:00:00 2001 From: Zlash65 Date: Mon, 21 May 2018 15:08:16 +0530 Subject: [PATCH] patch fix - skip query if no when_then case --- .../v11_0/create_department_records_for_each_company.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/patches/v11_0/create_department_records_for_each_company.py b/erpnext/patches/v11_0/create_department_records_for_each_company.py index bef524c34b..17e3ebd07f 100644 --- a/erpnext/patches/v11_0/create_department_records_for_each_company.py +++ b/erpnext/patches/v11_0/create_department_records_for_each_company.py @@ -47,6 +47,9 @@ def update_records(doctype, comp_dict): THEN "%s" '''%(company, department, records[department])) + if not when_then: + return + frappe.db.sql(""" update `tab%s`