Skip to content

Commit

Permalink
fix: Quality Inspection Rejection issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
bhattdevarsh committed Sep 28, 2020
1 parent 10f270b commit b85b0d1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion erpnext/stock/doctype/quality_inspection/quality_inspection.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,23 @@ frappe.ui.form.on("Quality Inspection", {
frappe.ui.form.on("Quality Inspection Reading", {
status: function (frm, cdt, cdn) {
let row = locals[cdt][cdn];
let not_rejected = true;
if (row.status === "Rejected") {
frappe.confirm(__("This will mark the Quality Inspection as 'Rejected'. Are you sure you want to proceed?"),
() => { frm.set_value("status", row.status); },
() => { frappe.reload_doc() }
() => { frappe.model.set_value(cdt, cdn, "status", "Accepted") }
);
}
else{
frm.doc.readings.forEach(reading => {
if (reading.status === "Rejected"){
not_rejected = false;
}
});
if (not_rejected){
frm.set_value("status", "Accepted");
}
}
}
})

Expand Down

0 comments on commit b85b0d1

Please sign in to comment.