link warehouse with account
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index df2c694..e147ee3 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -146,4 +146,5 @@
erpnext.patches.v4_2.delete_gl_entries_for_cancelled_invoices
erpnext.patches.v5_0.project_costing
erpnext.patches.v5_0.update_temporary_account
-erpnext.patches.v5_0.update_advance_paid
\ No newline at end of file
+erpnext.patches.v5_0.update_advance_paid
+erpnext.patches.v5_0.link_warehouse_with_account
\ No newline at end of file
diff --git a/erpnext/patches/v4_2/party_model.py b/erpnext/patches/v4_2/party_model.py
index 897598f..ac9a141 100644
--- a/erpnext/patches/v4_2/party_model.py
+++ b/erpnext/patches/v4_2/party_model.py
@@ -15,11 +15,6 @@
delete_individual_party_account()
remove_customer_supplier_account_report()
-
-def link_warehouse_account():
- frappe.db.sql("""update tabAccount set warehouse=master_name
- where ifnull(account_type, '') = 'Warehouse' and ifnull(master_name, '') != ''""")
-
def create_receivable_payable_account():
receivable_payable_accounts = frappe._dict()
diff --git a/erpnext/patches/v5_0/link_warehouse_with_account.py b/erpnext/patches/v5_0/link_warehouse_with_account.py
new file mode 100644
index 0000000..87e9b49
--- /dev/null
+++ b/erpnext/patches/v5_0/link_warehouse_with_account.py
@@ -0,0 +1,9 @@
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+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