run set query if doctype exist (#14929)

This commit is contained in:
Zarrar
2018-07-17 11:57:06 +05:30
committed by Nabin Hait
parent 107dbcdff8
commit fc0a5833a5

View File

@@ -10,6 +10,7 @@ def execute():
'Timesheet', 'Sales Person', 'Payroll Employee Detail'] 'Timesheet', 'Sales Person', 'Payroll Employee Detail']
for doctype in doctypes_to_update: for doctype in doctypes_to_update:
if frappe.db.table_exists(doctype):
frappe.db.sql(""" frappe.db.sql("""
update `tab%s` dt update `tab%s` dt
set department=(select department from `tabEmployee` where name=dt.employee) set department=(select department from `tabEmployee` where name=dt.employee)