[patch] [fix]
diff --git a/erpnext/patches/v5_0/update_item_name_in_bom.py b/erpnext/patches/v5_0/update_item_name_in_bom.py
index 1e858c5..56472f8 100644
--- a/erpnext/patches/v5_0/update_item_name_in_bom.py
+++ b/erpnext/patches/v5_0/update_item_name_in_bom.py
@@ -4,9 +4,13 @@
 import frappe
 
 def execute():
+	frappe.reload_doc("manufacturing", "doctype", "bom")
+	frappe.reload_doc("manufacturing", "doctype", "bom_item")
+	frappe.reload_doc("manufacturing", "doctype", "bom_explosion_item")
+
 	frappe.db.sql("""update `tabBOM` as bom  set bom.item_name = \
 		( select item.item_name from `tabItem` as item  where item.name = bom.item)""")
 	frappe.db.sql("""update `tabBOM Item` as bomItem set bomItem.item_name = ( select item.item_name  \
 		from `tabItem` as item where item.name = bomItem.item_code)""")
 	frappe.db.sql("""update `tabBOM Explosion Item` as explosionItem set explosionItem.item_name = \
-		( select item.item_name from `tabItem` as item where item.name = explosionItem.item_code)""")
\ No newline at end of file
+		( select item.item_name from `tabItem` as item where item.name = explosionItem.item_code)""")