2016-07-19 08:47:33 +00:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
import frappe
|
2016-07-21 10:31:59 +00:00
|
|
|
from erpnext.setup.setup_wizard import domainify
|
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-07-21 10:31:59 +00:00
|
|
|
if 'schools' in frappe.get_installed_apps():
|
2016-07-21 11:42:47 +00:00
|
|
|
frappe.get_doc('Portal Settings', 'Portal Settings').sync_menu()
|
2016-07-21 11:11:05 +00:00
|
|
|
frappe.db.sql("""delete from `tabDesktop Icon`""")
|
2016-07-21 12:52:58 +00:00
|
|
|
if not frappe.db.exists('Module Def', 'Schools'):
|
|
|
|
frappe.get_doc({
|
|
|
|
'doctype': 'Module Def',
|
|
|
|
'module_name': 'Schools',
|
|
|
|
'app_name': 'erpnext'
|
|
|
|
}).insert()
|
2016-07-21 11:27:04 +00:00
|
|
|
frappe.db.sql("""update `tabDocType` set module='Schools' where module='Academics'""")
|
2016-07-21 10:31:59 +00:00
|
|
|
from frappe.installer import remove_from_installed_apps
|
|
|
|
remove_from_installed_apps("schools")
|
|
|
|
domainify.setup_domain('Education')
|
|
|
|
else:
|
2016-07-21 11:42:47 +00:00
|
|
|
frappe.get_doc('Portal Settings', 'Portal Settings').sync_menu()
|
2016-07-21 10:31:59 +00:00
|
|
|
domainify.setup_sidebar_items(domainify.get_domain('Manufacturing'))
|
2016-07-22 06:49:18 +00:00
|
|
|
|
|
|
|
def reload_doctypes_for_schools_icons():
|
|
|
|
for name in ('student', 'student_group', 'course_schedule', 'student_attendance',
|
2016-07-22 06:50:52 +00:00
|
|
|
'course', 'program', 'student_applicant', 'examination', 'fees', 'instructor', 'announcement'):
|
2016-07-22 06:49:18 +00:00
|
|
|
frappe.reload_doc('schools', 'doctype', name)
|