Merge pull request #48298 from FHenry/dev_fix_support_42326

fix: default UOMs by new Stock Entry created by Stock Level section button (when Item is batch or serial)
This commit is contained in:
rohitwaghchaure
2025-06-30 11:02:05 +05:30
committed by GitHub

View File

@@ -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;