2016-07-19 08:47:33 +00:00
|
|
|
from __future__ import unicode_literals
|
2016-08-10 14:15:59 +00:00
|
|
|
import frappe, os
|
2016-08-16 13:01:09 +00:00
|
|
|
from frappe.installer import remove_from_installed_apps
|
2016-07-19 08:47:33 +00:00
|
|
|
|
|
|
|
def execute():
|
2016-07-22 06:49:18 +00:00
|
|
|
reload_doctypes_for_schools_icons()
|
2016-07-22 06:01:31 +00:00
|
|
|
|
|
|
|
frappe.reload_doc('website', 'doctype', 'portal_settings')
|
|
|
|
frappe.reload_doc('website', 'doctype', 'portal_menu_item')
|
|
|
|
frappe.reload_doc('buying', 'doctype', 'request_for_quotation')
|
|
|
|
|
2016-08-22 09:06:33 +00:00
|
|
|
if 'schools' in frappe.get_installed_apps():
|
2016-08-16 13:01:09 +00:00
|
|
|
if not frappe.db.exists('Module Def', 'Schools') and frappe.db.exists('Module Def', 'Academics'):
|
2019-01-30 05:30:36 +00:00
|
|
|
|
2017-11-23 09:52:10 +00:00
|
|
|
# 'Schools' module changed to the 'Education'
|
|
|
|
# frappe.rename_doc("Module Def", "Academics", "Schools")
|
2019-01-30 05:30:36 +00:00
|
|
|
|
2017-11-23 09:52:10 +00:00
|
|
|
frappe.rename_doc("Module Def", "Academics", "Education")
|
2019-01-30 05:30:36 +00:00
|
|
|
|
2016-07-21 10:31:59 +00:00
|
|
|
remove_from_installed_apps("schools")
|
2016-07-22 06:49:18 +00:00
|
|
|
|
|
|
|
def reload_doctypes_for_schools_icons():
|
2017-11-23 09:52:10 +00:00
|
|
|
# 'Schools' module changed to the 'Education'
|
|
|
|
# base_path = frappe.get_app_path('erpnext', 'schools', 'doctype')
|
2019-01-30 05:30:36 +00:00
|
|
|
|
2017-11-23 09:52:10 +00:00
|
|
|
base_path = frappe.get_app_path('erpnext', 'education', 'doctype')
|
2016-08-10 14:15:59 +00:00
|
|
|
for doctype in os.listdir(base_path):
|
2016-08-16 13:01:09 +00:00
|
|
|
if os.path.exists(os.path.join(base_path, doctype, doctype + '.json')) \
|
|
|
|
and doctype not in ("fee_component", "assessment", "assessment_result"):
|
2017-11-23 09:52:10 +00:00
|
|
|
frappe.reload_doc('education', 'doctype', doctype)
|