From 1ce45f623ec66c3055a265a843340a71d6195409 Mon Sep 17 00:00:00 2001 From: marination Date: Mon, 9 May 2022 13:00:00 +0530 Subject: [PATCH] fix: Set actual qty and basic rate in SE on warehouse triggers (`get_warehouse_details`) - set `actual_qty` on source and target warehouse change --- erpnext/stock/doctype/stock_entry/stock_entry.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 1df56ef7b4..540ad186e1 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -470,7 +470,9 @@ frappe.ui.form.on('Stock Entry', { }, callback: function(r) { if (!r.exc) { - $.extend(child, r.message); + ["actual_qty", "basic_rate"].forEach((field) => { + frappe.model.set_value(cdt, cdn, field, (r.message[field] || 0.0)); + }); frm.events.calculate_basic_amount(frm, child); } } @@ -1057,8 +1059,8 @@ function attach_bom_items(bom_no) { function check_should_not_attach_bom_items(bom_no) { return ( - bom_no === undefined || - (erpnext.stock.bom && erpnext.stock.bom.name === bom_no) + bom_no === undefined || + (erpnext.stock.bom && erpnext.stock.bom.name === bom_no) ); }