Update fix_account_master_type.py
diff --git a/erpnext/patches/v4_2/fix_account_master_type.py b/erpnext/patches/v4_2/fix_account_master_type.py
index 09fa789..d4603f2 100644
--- a/erpnext/patches/v4_2/fix_account_master_type.py
+++ b/erpnext/patches/v4_2/fix_account_master_type.py
@@ -6,7 +6,7 @@
 
 def execute():
 	for d in frappe.db.sql("""select name from `tabAccount`
-		where ifnull(master_type, '') not in ('Customer', 'Supplier', 'Employee', '')"""):
+		where ifnull(master_type, '') not in ('Customer', 'Supplier', 'Employee', '') and docstatus=0"""):
 			ac = frappe.get_doc("Account", d[0])
 			ac.master_type = None
 			ac.save()