diff --git a/erpnext/patches/v5_0/link_warehouse_with_account.py b/erpnext/patches/v5_0/link_warehouse_with_account.py index 87e9b491123..338fd7ad7f6 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 @@ from __future__ import unicode_literals 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