brotherton-erpnext/erpnext/patches/v7_2/rename_evaluation_criteria.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
2.1 KiB
Python
Raw Normal View History

from __future__ import unicode_literals
2017-02-01 14:02:28 +00:00
import frappe
from frappe.model.utils.rename_field import rename_field
def execute():
# 'Schools' module changed to the 'Education'
2017-02-03 10:35:53 +00:00
frappe.rename_doc("DocType", "Evaluation Criteria", "Assessment Criteria", force=True)
# frappe.reload_doc("schools", "doctype", "assessment_criteria")
frappe.reload_doc("education", "doctype", "assessment_criteria")
2017-02-03 10:35:53 +00:00
if 'evaluation_criteria' in frappe.db.get_table_columns('Assessment Criteria'):
rename_field("Assessment Criteria", "evaluation_criteria", "assessment_criteria")
2017-02-01 14:02:28 +00:00
2017-02-03 10:35:53 +00:00
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")
2017-02-03 10:35:53 +00:00
if 'evaluation_criteria' in frappe.db.get_table_columns('Assessment Plan'):
rename_field("Assessment Plan Criteria", "evaluation_criteria", "assessment_criteria")
2017-02-01 14:02:28 +00:00
# frappe.reload_doc("schools", "doctype", "assessment_plan")
frappe.reload_doc("education", "doctype", "assessment_plan")
2017-02-03 10:35:53 +00:00
rename_field("Assessment Plan", "evaluation_criterias", "assessment_criteria")
2017-02-01 14:02:28 +00:00
# frappe.reload_doc("schools", "doctype", "assessment_result_detail")
frappe.reload_doc("education", "doctype", "assessment_result_detail")
2017-02-03 10:35:53 +00:00
if 'evaluation_criteria' in frappe.db.get_table_columns('Assessment Result Detail'):
rename_field("Assessment Result Detail", "evaluation_criteria", "assessment_criteria")
2017-02-01 14:02:28 +00:00
2017-02-03 10:35:53 +00:00
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")
2017-02-03 10:35:53 +00:00
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")
2017-02-03 10:35:53 +00:00
if 'evaluation_criteria' in frappe.db.get_table_columns('Course'):
rename_field("Course", "evaluation_criterias", "assessment_criteria")