fix: available qty not fetching for raw material in PP
diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.js b/erpnext/manufacturing/doctype/production_plan/production_plan.js
index ab7aa52..45a59cf 100644
--- a/erpnext/manufacturing/doctype/production_plan/production_plan.js
+++ b/erpnext/manufacturing/doctype/production_plan/production_plan.js
@@ -451,10 +451,14 @@
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
+ });
+ }
}
})
}