Fix account's master type

This commit is contained in:
Nabin Hait 2014-08-07 15:03:25 +05:30
parent 43ffa64849
commit 05b56d0d08
2 changed files with 13 additions and 0 deletions

View File

@ -73,3 +73,4 @@ execute:frappe.delete_doc("DocType", "Payment to Invoice Matching Tool Detail")
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

View File

@ -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()