
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, '') != ''""")

from __future__ import unicode_literals
import frappe

def execute():
	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, '') != ''""")
Update warehouse as per master_name if master_name exists
Update warehouse as per master_name if master_name exists

  
  from __future__ import unicode_literals
  import frappe
  
  def execute():
+ 	if "master_name" in frappe.db.get_table_columns("Account"):	
- 	frappe.db.sql("""update tabAccount set warehouse=master_name
+ 		frappe.db.sql("""update tabAccount set warehouse=master_name
- 		where ifnull(account_type, '') = 'Warehouse' and ifnull(master_name, '') != ''""")
+ 			where ifnull(account_type, '') = 'Warehouse' and ifnull(master_name, '') != ''""")
Update warehouse as per master_name if master_name exists
## Code Before:

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, '') != ''""")
## Instruction:
Update warehouse as per master_name if master_name exists
## Code After:

from __future__ import unicode_literals
import frappe

def execute():
	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, '') != ''""")