Skip to content

Commit 0d1c30f

Browse files
mihir-kandoimergify[bot]
authored andcommitted
fix: hide close button on WO if WO is completed
(cherry picked from commit 6e17ccf)
1 parent d0b553d commit 0d1c30f

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

erpnext/manufacturing/doctype/work_order/work_order.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ erpnext.work_order = {
710710
set_custom_buttons: function (frm) {
711711
var doc = frm.doc;
712712

713-
if (doc.docstatus === 1 && doc.status !== "Closed") {
713+
if (doc.docstatus === 1 && !["Closed", "Completed"].includes(doc.status)) {
714714
frm.add_custom_button(
715715
__("Close"),
716716
function () {
@@ -720,9 +720,6 @@ erpnext.work_order = {
720720
},
721721
__("Status")
722722
);
723-
}
724-
725-
if (doc.docstatus === 1 && !["Closed", "Completed"].includes(doc.status)) {
726723
if (doc.status != "Stopped" && doc.status != "Completed") {
727724
frm.add_custom_button(
728725
__("Stop"),

0 commit comments

Comments
 (0)