fix: hide close button on WO if WO is completed

(cherry picked from commit 6e17ccf499)
This commit is contained in:
Mihir Kandoi
2026-01-30 11:56:38 +05:30
committed by Mergify
parent 85f7196eb5
commit bd96868736

View File

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