Merge pull request #6038 from nabinhait/portal_settings_schools
Portal settings for schools
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index 566a98b..c1cee0c 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -101,7 +101,7 @@
{"title": _("Addresses"), "route": "/addresses", "reference_doctype": "Address"},
{"title": _("Announcements"), "route": "/announcement", "reference_doctype": "Announcement"},
{"title": _("Courses"), "route": "/course", "reference_doctype": "Course"},
- {"title": _("Assessment Schedule"), "route": "/Assessment", "reference_doctype": "Assessment"},
+ {"title": _("Assessment Schedule"), "route": "/assessment", "reference_doctype": "Assessment"},
{"title": _("Fees"), "route": "/fees", "reference_doctype": "Fees"}
]
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 00f4095..fd1fc74 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -308,5 +308,6 @@
erpnext.patches.v7_0.update_refdoc_in_landed_cost_voucher
erpnext.patches.v7_0.set_material_request_type_in_item
erpnext.patches.v7_0.rename_examination_to_assessment
+erpnext.patches.v7_0.set_portal_settings
erpnext.patches.v7_0.repost_future_gle_for_purchase_invoice
erpnext.patches.v7_0.fix_duplicate_icons
\ No newline at end of file
diff --git a/erpnext/patches/v7_0/migrate_schools_to_erpnext.py b/erpnext/patches/v7_0/migrate_schools_to_erpnext.py
index 04c65fa..2376cc4 100644
--- a/erpnext/patches/v7_0/migrate_schools_to_erpnext.py
+++ b/erpnext/patches/v7_0/migrate_schools_to_erpnext.py
@@ -1,6 +1,5 @@
from __future__ import unicode_literals
import frappe
-from erpnext.setup.setup_wizard import domainify
def execute():
reload_doctypes_for_schools_icons()
@@ -10,7 +9,6 @@
frappe.reload_doc('buying', 'doctype', 'request_for_quotation')
if 'schools' in frappe.get_installed_apps():
- frappe.get_doc('Portal Settings', 'Portal Settings').sync_menu()
frappe.db.sql("""delete from `tabDesktop Icon`""")
if not frappe.db.exists('Module Def', 'Schools'):
frappe.get_doc({
@@ -21,12 +19,9 @@
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:
- frappe.get_doc('Portal Settings', 'Portal Settings').sync_menu()
- domainify.setup_sidebar_items(domainify.get_domain('Manufacturing'))
def reload_doctypes_for_schools_icons():
- for name in ('student', 'student_group', 'course_schedule', 'student_attendance', 'room', 'program_enrollment',
- 'course', 'program', 'student_applicant', 'examination', 'fees', 'instructor', 'announcement'):
- frappe.reload_doc('schools', 'doctype', name)
+ for name in ('student', 'student_group', 'course_schedule', 'student_attendance', 'room',
+ 'program_enrollment', 'course', 'program', 'student_applicant', 'fees',
+ 'instructor', 'announcement'):
+ frappe.reload_doc('schools', 'doctype', name)
diff --git a/erpnext/patches/v7_0/rename_examination_to_assessment.py b/erpnext/patches/v7_0/rename_examination_to_assessment.py
index 31c8aed..3c79c51 100644
--- a/erpnext/patches/v7_0/rename_examination_to_assessment.py
+++ b/erpnext/patches/v7_0/rename_examination_to_assessment.py
@@ -12,4 +12,5 @@
frappe.reload_doctype("Assessment")
rename_field("Assessment", "exam_name", "assessment_name")
rename_field("Assessment", "exam_code", "assessment_code")
-
\ No newline at end of file
+
+ frappe.db.sql("delete from `tabPortal Menu Item` where route = '/examination'")
\ No newline at end of file
diff --git a/erpnext/patches/v7_0/set_portal_settings.py b/erpnext/patches/v7_0/set_portal_settings.py
new file mode 100644
index 0000000..3e3b729
--- /dev/null
+++ b/erpnext/patches/v7_0/set_portal_settings.py
@@ -0,0 +1,18 @@
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+
+import frappe
+from erpnext.setup.setup_wizard import domainify
+
+def execute():
+ for dt in ("assessment", "announcement", "course", "fees"):
+ frappe.reload_doc("schools", "doctype", dt)
+
+ frappe.get_doc('Portal Settings').sync_menu()
+
+ if 'schools' in frappe.get_installed_apps():
+ domainify.setup_domain('Education')
+ else:
+ domainify.setup_sidebar_items(domainify.get_domain('Manufacturing'))
\ No newline at end of file