brotherton-erpnext/erpnext/patches/v7_0/migrate_schools_to_erpnext.py

20 lines
872 B
Python
Raw Normal View History

2016-07-19 08:47:33 +00:00
from __future__ import unicode_literals
import frappe
from erpnext.setup.setup_wizard import domainify
2016-07-19 08:47:33 +00:00
def execute():
if 'schools' in frappe.get_installed_apps():
2016-07-21 11:42:47 +00:00
frappe.get_doc('Portal Settings', 'Portal Settings').sync_menu()
frappe.db.sql("""delete from `tabDesktop Icon`""")
frappe.db.sql("""update `tabDocType` set module='Schools' where module='Academics'""")
from frappe.installer import remove_from_installed_apps
remove_from_installed_apps("schools")
domainify.setup_domain('Education')
else:
2016-07-21 11:44:27 +00:00
frappe.reload_doc('schools', 'doctype', 'announcement')
frappe.reload_doc('schools', 'doctype', 'course')
frappe.reload_doc('schools', 'doctype', 'fees')
frappe.reload_doc('schools', 'doctype', 'examination')
2016-07-21 11:42:47 +00:00
frappe.get_doc('Portal Settings', 'Portal Settings').sync_menu()
domainify.setup_sidebar_items(domainify.get_domain('Manufacturing'))