fix: hide close button on WO if WO is completed

This commit is contained in:
Mihir Kandoi
2026-01-30 11:56:38 +05:30
parent b565dd3da8
commit 6e17ccf499

View File

@@ -710,7 +710,7 @@ erpnext.work_order = {
set_custom_buttons: function (frm) {
var doc = frm.doc;
if (doc.docstatus === 1 && doc.status !== "Closed") {
if (doc.docstatus === 1 && !["Closed", "Completed"].includes(doc.status)) {
frm.add_custom_button(
__("Close"),
function () {
@@ -720,9 +720,6 @@ erpnext.work_order = {
},
__("Status")
);
}
if (doc.docstatus === 1 && !["Closed", "Completed"].includes(doc.status)) {
if (doc.status != "Stopped" && doc.status != "Completed") {
frm.add_custom_button(
__("Stop"),