From 1160df93501a33312ddf94f36018e78d55039cb7 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 12:45:48 +0530 Subject: [PATCH] fix: add multiple item issue in stock entry (backport #45544) (#45579) fix: add multiple item issue in stock entry (#45544) (cherry picked from commit 5a023dc8d47dc12dcf2e3f031a409f592f54a867) Co-authored-by: Ejaaz Khan <67804911+iamejaaz@users.noreply.github.com> --- erpnext/stock/doctype/stock_entry/stock_entry.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 6d18a21fbe3..1eefd552c29 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -803,7 +803,12 @@ frappe.ui.form.on('Stock Entry Detail', { var d = locals[cdt][cdn]; $.each(r.message, function(k, v) { if (v) { - frappe.model.set_value(cdt, cdn, k, v); // qty and it's subsequent fields weren't triggered + // set_value trigger barcode function and barcode set qty to 1 in stock_controller.js, to avoid this set value manually instead of set value. + if (k != "barcode") { + frappe.model.set_value(cdt, cdn, k, v); // qty and it's subsequent fields weren't triggered + } else { + d.barcode = v; + } } }); refresh_field("items");