Merge pull request #16139 from Zlash65/fix-assess

[Minor] Assessment Result fix
This commit is contained in:
Nabin Hait 2018-12-03 14:33:01 +05:30 committed by GitHub
commit 6b93f2fe0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,6 +50,12 @@ frappe.ui.form.on("Assessment Result", {
frappe.ui.form.on("Assessment Result Detail", { frappe.ui.form.on("Assessment Result Detail", {
score: function(frm, cdt, cdn) { score: function(frm, cdt, cdn) {
var d = locals[cdt][cdn]; var d = locals[cdt][cdn];
if(!d.maximum_score || !frm.doc.grading_scale) {
d.score = "";
frappe.throw(__("Please fill in all the details to generate Assessment Result."));
}
if (d.score > d.maximum_score) { if (d.score > d.maximum_score) {
frappe.throw(__("Score cannot be greater than Maximum Score")); frappe.throw(__("Score cannot be greater than Maximum Score"));
} }