From e7da4992f3167814a121911978bc00a940b6ed13 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 27 Jun 2025 12:54:28 +0200 Subject: [PATCH] fix: default UOMs by new stock Entry created by Stock Level section button --- erpnext/stock/dashboard/item_dashboard.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/dashboard/item_dashboard.js b/erpnext/stock/dashboard/item_dashboard.js index 6fc9e6666a2..17f65ce270c 100644 --- a/erpnext/stock/dashboard/item_dashboard.js +++ b/erpnext/stock/dashboard/item_dashboard.js @@ -51,7 +51,7 @@ erpnext.stock.ItemDashboard = class ItemDashboard { let stock_uom = unescape(element.attr("data-stock-uom")); if (disable_quick_entry) { - open_stock_entry(item, warehouse, entry_type); + open_stock_entry(item, warehouse, entry_type, stock_uom); } else { if (action === "Add") { let rate = unescape($(this).attr("data-rate")); @@ -66,7 +66,7 @@ erpnext.stock.ItemDashboard = class ItemDashboard { } } - function open_stock_entry(item, warehouse, entry_type) { + function open_stock_entry(item, warehouse, entry_type, stock_uom) { frappe.model.with_doctype("Stock Entry", function () { var doc = frappe.model.get_new_doc("Stock Entry"); if (entry_type) { @@ -75,6 +75,9 @@ erpnext.stock.ItemDashboard = class ItemDashboard { var row = frappe.model.add_child(doc, "items"); row.item_code = item; + row.uom = stock_uom; + row.stock_uom = stock_uom; + row.conversion_factor = 1; if (entry_type === "Material Transfer") { row.s_warehouse = warehouse;