From 36f2d4f81e4bd9fec55e583341f143cbd92776be Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 10 Aug 2016 19:45:59 +0530 Subject: [PATCH] [fix] patch for schools; --- erpnext/patches/v7_0/migrate_schools_to_erpnext.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/erpnext/patches/v7_0/migrate_schools_to_erpnext.py b/erpnext/patches/v7_0/migrate_schools_to_erpnext.py index 695f6ccbcd..80e9eac896 100644 --- a/erpnext/patches/v7_0/migrate_schools_to_erpnext.py +++ b/erpnext/patches/v7_0/migrate_schools_to_erpnext.py @@ -1,5 +1,5 @@ from __future__ import unicode_literals -import frappe +import frappe, os def execute(): reload_doctypes_for_schools_icons() @@ -21,5 +21,7 @@ def execute(): remove_from_installed_apps("schools") def reload_doctypes_for_schools_icons(): - for d in frappe.get_all('DocType', filters={'module': 'Schools'}): - frappe.reload_doc('schools', 'doctype', frappe.scrub(d.name)) + base_path = frappe.get_app_path('erpnext', 'schools', 'doctype') + for doctype in os.listdir(base_path): + if os.path.exists(os.path.join(base_path, doctype, doctype + '.json')): + frappe.reload_doc('schools', 'doctype', doctype)