From ba7ed4626c03f50b0d13614ba904392dff40c251 Mon Sep 17 00:00:00 2001 From: Manas Solanki Date: Wed, 7 Jun 2017 11:57:11 +0530 Subject: [PATCH] fetch query for assessment group (#9120) --- .../doctype/assessment_plan/assessment_plan.js | 12 +++++++++++- .../doctype/assessment_plan/assessment_plan.py | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/erpnext/schools/doctype/assessment_plan/assessment_plan.js b/erpnext/schools/doctype/assessment_plan/assessment_plan.js index 3c9ab80d2d..abdb0c812a 100644 --- a/erpnext/schools/doctype/assessment_plan/assessment_plan.js +++ b/erpnext/schools/doctype/assessment_plan/assessment_plan.js @@ -6,7 +6,17 @@ cur_frm.add_fetch("examiner", "instructor_name", "examiner_name"); cur_frm.add_fetch("supervisor", "instructor_name", "supervisor_name"); frappe.ui.form.on("Assessment Plan", { - refresh: function(frm) { + onload: function(frm) { + frm.set_query("assessment_group", function(doc, cdt, cdn) { + return{ + filters: { + 'is_group': 0 + } + } + }); + }, + + refresh: function(frm) { if (frm.doc.docstatus == 1) { frm.add_custom_button(__("Assessment Result"), function() { frappe.route_options = { diff --git a/erpnext/schools/doctype/assessment_plan/assessment_plan.py b/erpnext/schools/doctype/assessment_plan/assessment_plan.py index 7f83c0176b..f988886fca 100644 --- a/erpnext/schools/doctype/assessment_plan/assessment_plan.py +++ b/erpnext/schools/doctype/assessment_plan/assessment_plan.py @@ -36,4 +36,4 @@ class AssessmentPlan(Document): for d in self.assessment_criteria: max_score += d.maximum_score if self.maximum_assessment_score != max_score: - frappe.throw(_("Sum of Scores of Assessment Criteria needs to be {0}.".format(self.maximum_assessment_score))) \ No newline at end of file + frappe.throw(_("Sum of Scores of Assessment Criteria needs to be {0}.".format(self.maximum_assessment_score)))