From 6f87f97efe521526d3eac512305c7c6b62bb3b9e Mon Sep 17 00:00:00 2001 From: P-Froggy <60393001+P-Froggy@users.noreply.github.com> Date: Fri, 5 Jun 2020 07:27:07 +0200 Subject: [PATCH] fix: Wrong Ordered-Status Indicator for Material Request Items (#22118) The indicator displaying if a material request item has been ordered or not (green/orange) used the wrong quantity field for determining the status. The qty field used in the code is not in stock uom while the ordered_qty field is. Now, the stock_qty field is used for correct comparison with ordered_qty. --- erpnext/stock/doctype/material_request/material_request.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/material_request/material_request.js b/erpnext/stock/doctype/material_request/material_request.js index 3562181e25..3a8deb6d25 100644 --- a/erpnext/stock/doctype/material_request/material_request.js +++ b/erpnext/stock/doctype/material_request/material_request.js @@ -18,7 +18,7 @@ frappe.ui.form.on('Material Request', { // formatter for material request item frm.set_indicator_formatter('item_code', - function(doc) { return (doc.qty<=doc.ordered_qty) ? "green" : "orange"; }); + function(doc) { return (doc.stock_qty<=doc.ordered_qty) ? "green" : "orange"; }); frm.set_query("item_code", "items", function() { return {