Renamed min_score to threshold in Grading Scale

This commit is contained in:
Neil Trini Lasrado 2017-01-04 15:41:38 +05:30
parent 577cfd559f
commit 233ecfdd9c
3 changed files with 7 additions and 6 deletions

View File

@ -7,7 +7,7 @@ def execute():
frappe.rename_doc("DocType", "Grade Interval", "Grading Scale Interval", force=True)
frappe.reload_doc("schools", "doctype", "grading_scale_interval")
rename_field("Grading Scale Interval", "to_score", "min_score")
rename_field("Grading Scale Interval", "to_score", "threshold")
#Rename Assessment Results
frappe.reload_doc("schools", "doctype", "assessment")

View File

@ -191,8 +191,8 @@ def get_grade(grading_scale, percentage):
:param Percentage: Score Percentage Percentage
"""
grading_scale_intervals = {}
for d in frappe.get_all("Grading Scale Interval", fields=["grade_code", "min_score"], filters={"parent": grading_scale}):
grading_scale_intervals.update({d.min_score:d.grade_code})
for d in frappe.get_all("Grading Scale Interval", fields=["grade_code", "threshold"], filters={"parent": grading_scale}):
grading_scale_intervals.update({d.threshold:d.grade_code})
intervals = sorted(grading_scale_intervals.keys(), key=float, reverse=True)
for interval in intervals:
if flt(percentage) >= interval:

View File

@ -45,7 +45,7 @@
"collapsible": 0,
"columns": 0,
"default": "0",
"fieldname": "min_score",
"fieldname": "threshold",
"fieldtype": "Percent",
"hidden": 0,
"ignore_user_permissions": 0,
@ -53,7 +53,7 @@
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Min Score",
"label": "Threshold",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -107,7 +107,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-12-29 17:10:26.153591",
"modified": "2017-01-04 15:27:56.729286",
"modified_by": "Administrator",
"module": "Schools",
"name": "Grading Scale Interval",
@ -119,5 +119,6 @@
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0
}