add reload doc to patch
diff --git a/erpnext/patches/v5_0/set_default_company_in_bom.py b/erpnext/patches/v5_0/set_default_company_in_bom.py
index e5dc86c..53935ff 100644
--- a/erpnext/patches/v5_0/set_default_company_in_bom.py
+++ b/erpnext/patches/v5_0/set_default_company_in_bom.py
@@ -4,5 +4,6 @@
import frappe
def execute():
+ frappe.reload_doc("manufacturing", "doctype", "bom")
company = frappe.db.get_value("Global Defaults", None, "default_company")
frappe.db.sql("""update `tabBOM` set company = %s""",company)