brotherton-erpnext/erpnext/patches/v7_2/rename_evaluation_criteria.py
Manas Solanki 966f141f62 Rename schools to Education (#11524)
* renaming for the docs, demo data and patch

* changes in the doctypes and reports

* rename the config file

* Few name changes in messages and license

* rename the school settings to education settings

* changes in the documentation

* added the setup file for the fixtures

* corrected the ui tests file path

* fix the codacy

* add the patch for renaming few doctypes and fields

* changes in the patch
2017-11-23 15:22:10 +05:30

39 lines
2.1 KiB
Python

import frappe
from frappe.model.utils.rename_field import rename_field
def execute():
# 'Schools' module changed to the 'Education'
frappe.rename_doc("DocType", "Evaluation Criteria", "Assessment Criteria", force=True)
# frappe.reload_doc("schools", "doctype", "assessment_criteria")
frappe.reload_doc("education", "doctype", "assessment_criteria")
if 'evaluation_criteria' in frappe.db.get_table_columns('Assessment Criteria'):
rename_field("Assessment Criteria", "evaluation_criteria", "assessment_criteria")
frappe.rename_doc("DocType", "Assessment Evaluation Criteria", "Assessment Plan Criteria", force=True)
# frappe.reload_doc("schools", "doctype", "assessment_plan_criteria")
frappe.reload_doc("education", "doctype", "assessment_plan_criteria")
if 'evaluation_criteria' in frappe.db.get_table_columns('Assessment Plan'):
rename_field("Assessment Plan Criteria", "evaluation_criteria", "assessment_criteria")
# frappe.reload_doc("schools", "doctype", "assessment_plan")
frappe.reload_doc("education", "doctype", "assessment_plan")
rename_field("Assessment Plan", "evaluation_criterias", "assessment_criteria")
# frappe.reload_doc("schools", "doctype", "assessment_result_detail")
frappe.reload_doc("education", "doctype", "assessment_result_detail")
if 'evaluation_criteria' in frappe.db.get_table_columns('Assessment Result Detail'):
rename_field("Assessment Result Detail", "evaluation_criteria", "assessment_criteria")
frappe.rename_doc("DocType", "Course Evaluation Criteria", "Course Assessment Criteria", force=True)
# frappe.reload_doc("schools", "doctype", "course_assessment_criteria")
frappe.reload_doc("education", "doctype", "course_assessment_criteria")
if 'evaluation_criteria' in frappe.db.get_table_columns('Course Assessment Criteria'):
rename_field("Course Assessment Criteria", "evaluation_criteria", "assessment_criteria")
# frappe.reload_doc("schools", "doctype", "course")
frappe.reload_doc("education", "doctype", "course")
if 'evaluation_criteria' in frappe.db.get_table_columns('Course'):
rename_field("Course", "evaluation_criterias", "assessment_criteria")