# 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, '') != ''""")
@@ -191,16 +191,79 @@
 cute():%0A
+%09if %22master_name%22 in frappe.db.get_table_columns(%22Account%22):%09%0A%09
 %09frappe.
@@ -316,16 +316,17 @@
 er_name%0A
+%09
 %09%09where 

Update warehouse as per master_name if master_name exists