fix(work_order): Use single update query
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
old mode 100755
new mode 100644
index 3785ec4..ee86816
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -586,4 +586,4 @@
 erpnext.patches.v12_0.set_task_status
 erpnext.patches.v10_0.item_barcode_childtable_migrate # 16-02-2019
 erpnext.patches.v11_0.make_italian_localization_fields # 01-03-2019
-erpnext.patches.v12_0.add_item_name_in_work_orders
+erpnext.patches.v12_0.add_item_name_in_work_orders
\ No newline at end of file
diff --git a/erpnext/patches/v12_0/add_item_name_in_work_orders.py b/erpnext/patches/v12_0/add_item_name_in_work_orders.py
index 35d526a..485dd31 100644
--- a/erpnext/patches/v12_0/add_item_name_in_work_orders.py
+++ b/erpnext/patches/v12_0/add_item_name_in_work_orders.py
@@ -4,10 +4,11 @@
 def execute():
 	frappe.reload_doc("manufacturing", "doctype", "work_order")
 
-	for wo in frappe.get_all("Work Order"):
-		item_code = frappe.db.get_value("Work Order", wo.name, "production_item")
-		item_name = frappe.db.get_value("Item", item_code, "item_name")
-
-		frappe.db.set_value("Work Order", wo.name, "item_name", item_name, update_modified=False)
-
+	frappe.db.sql("""
+		UPDATE
+			`tabWork Order` wo
+				JOIN `tabItem` item ON wo.production_item = item.item_code
+		SET
+			wo.item_name = item.item_name
+	""")
 	frappe.db.commit()
\ No newline at end of file