Skip to content

Commit

Permalink
fix(ux): allow MR to Stop until fully received (backport #37452) (#37456
Browse files Browse the repository at this point in the history
)

fix(ux): allow MR to Stop until fully received

(cherry picked from commit 0d7a0f3)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
  • Loading branch information
mergify[bot] and s-aga-r authored Oct 11, 2023
1 parent 63ff1f1 commit fb0b426
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions erpnext/stock/doctype/material_request/material_request.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ frappe.ui.form.on('Material Request', {

if (frm.doc.docstatus == 1 && frm.doc.status != 'Stopped') {
let precision = frappe.defaults.get_default("float_precision");

if (flt(frm.doc.per_received, precision) < 100) {
frm.add_custom_button(__('Stop'),
() => frm.events.update_status(frm, 'Stopped'));
}

if (flt(frm.doc.per_ordered, precision) < 100) {
let add_create_pick_list_button = () => {
frm.add_custom_button(__('Pick List'),
Expand Down Expand Up @@ -148,11 +154,6 @@ frappe.ui.form.on('Material Request', {
}

frm.page.set_inner_btn_group_as_primary(__('Create'));

// stop
frm.add_custom_button(__('Stop'),
() => frm.events.update_status(frm, 'Stopped'));

}
}

Expand Down

0 comments on commit fb0b426

Please sign in to comment.