From 8e3463c4ef4ac649fe12b91ee3ab7de11a680426 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 24 May 2023 14:12:58 +0530 Subject: [PATCH] fix: available qty not fetching for raw material in PP --- .../doctype/production_plan/production_plan.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.js b/erpnext/manufacturing/doctype/production_plan/production_plan.js index ab7aa52bb7..45a59cf732 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.js +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.js @@ -451,10 +451,14 @@ frappe.ui.form.on("Material Request Plan Item", { for_warehouse: row.warehouse }, callback: function(r) { - let {projected_qty, actual_qty} = r.message; + if (r.message) { + let {projected_qty, actual_qty} = r.message[0]; - frappe.model.set_value(cdt, cdn, 'projected_qty', projected_qty); - frappe.model.set_value(cdt, cdn, 'actual_qty', actual_qty); + frappe.model.set_value(cdt, cdn, { + 'projected_qty': projected_qty, + 'actual_qty': actual_qty + }); + } } }) }