diff --git a/erpnext/patches/v5_0/capacity_planning.py b/erpnext/patches/v5_0/capacity_planning.py index 9d1ec0a0b1f..f12f1f72416 100644 --- a/erpnext/patches/v5_0/capacity_planning.py +++ b/erpnext/patches/v5_0/capacity_planning.py @@ -5,4 +5,5 @@ import frappe def execute(): frappe.reload_doc("stock", "doctype", "stock_entry") - frappe.db.sql("update `tabStock Entry` set additional_operating_cost = total_fixed_cost") + if "total_fixed_cost" in frappe.db.get_table_columns("Stock Entry"): + frappe.db.sql("update `tabStock Entry` set additional_operating_cost = total_fixed_cost")