Update warehouse as per master_name if master_name exists
diff --git a/erpnext/patches/v5_0/link_warehouse_with_account.py b/erpnext/patches/v5_0/link_warehouse_with_account.py
index 87e9b49..338fd7a 100644
--- a/erpnext/patches/v5_0/link_warehouse_with_account.py
+++ b/erpnext/patches/v5_0/link_warehouse_with_account.py
@@ -5,5 +5,6 @@
import frappe
def execute():
- frappe.db.sql("""update tabAccount set warehouse=master_name
- where ifnull(account_type, '') = 'Warehouse' and ifnull(master_name, '') != ''""")
\ No newline at end of file
+ if "master_name" in frappe.db.get_table_columns("Account"):
+ frappe.db.sql("""update tabAccount set warehouse=master_name
+ where ifnull(account_type, '') = 'Warehouse' and ifnull(master_name, '') != ''""")
\ No newline at end of file