fix: hide "Return of Components" button in closed SCO (backport #32130) (#32131)

fix: hide "Return of Components" button in closed SCO (#32130)

(cherry picked from commit 3585daab95)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
This commit is contained in:
mergify[bot]
2022-09-08 18:25:27 +05:30
committed by GitHub
parent f2ab220ce3
commit 7840fed7a5

View File

@@ -107,7 +107,7 @@ frappe.ui.form.on('Subcontracting Order', {
get_materials_from_supplier: function (frm) {
let sco_rm_details = [];
if (frm.doc.supplied_items && frm.doc.per_received > 0) {
if (frm.doc.status != "Closed" && frm.doc.supplied_items && frm.doc.per_received > 0) {
frm.doc.supplied_items.forEach(d => {
if (d.total_supplied_qty > 0 && d.total_supplied_qty != d.consumed_qty) {
sco_rm_details.push(d.name);