Fix account's master type
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 7fc858d..1ae0a95 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -73,3 +73,4 @@
 execute:frappe.delete_doc("Page", "trial-balance") #2014-07-22
 erpnext.patches.v4_2.delete_old_print_formats #2014-07-29
 erpnext.patches.v4_2.toggle_rounded_total #2014-07-30
+erpnext.patches.v4_2.fix_account_master_type
diff --git a/erpnext/patches/v4_2/fix_account_master_type.py b/erpnext/patches/v4_2/fix_account_master_type.py
new file mode 100644
index 0000000..09fa789
--- /dev/null
+++ b/erpnext/patches/v4_2/fix_account_master_type.py
@@ -0,0 +1,12 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+	for d in frappe.db.sql("""select name from `tabAccount`
+		where ifnull(master_type, '') not in ('Customer', 'Supplier', 'Employee', '')"""):
+			ac = frappe.get_doc("Account", d[0])
+			ac.master_type = None
+			ac.save()