import xhiveframework


def execute():
	xhiveframework.reload_doc("manufacturing", "doctype", "work_order")

	xhiveframework.db.sql(
		"""
		UPDATE
			`tabWork Order` wo
				JOIN `tabItem` item ON wo.production_item = item.item_code
		SET
			wo.item_name = item.item_name
	"""
	)
	xhiveframework.db.commit()
