From e321e95e59ab8161a92e2ef019291bb77df6fca7 Mon Sep 17 00:00:00 2001 From: PranavDarade Date: Sun, 5 Jul 2026 20:03:56 +0530 Subject: [PATCH] fix(stock): set stock_uom on transferred Stock Reservation Entries StockReservation.transfer_reservation_entries_to() created the transferred SREs without copying stock_uom, in both the entries_to_reserve dict and the extra-items fallback. get_items_to_reserve() already selects the item's stock_uom, so entry.stock_uom is used. On sites with a global default stock_uom (e.g. "Nos"), frappe's _set_defaults() backfilled the blank field, so the transfer silently stored the wrong UOM for any item whose stock UOM is not the default. On sites without that default the SRE's validate_mandatory() raised "Stock UOM is required", aborting Work Order submission for the Subcontracting Inward Order / Production Plan flows. (cherry picked from commit 5991ecfa3d0addddb9dc66fff454405016f91e0a) --- .../doctype/stock_reservation_entry/stock_reservation_entry.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/stock/doctype/stock_reservation_entry/stock_reservation_entry.py b/erpnext/stock/doctype/stock_reservation_entry/stock_reservation_entry.py index 3dbdc2419c9..3c9d56e8216 100644 --- a/erpnext/stock/doctype/stock_reservation_entry/stock_reservation_entry.py +++ b/erpnext/stock/doctype/stock_reservation_entry/stock_reservation_entry.py @@ -1345,6 +1345,7 @@ class StockReservation: "voucher_type": entry.voucher_type or to_doctype, "voucher_no": entry.voucher_no, "voucher_detail_no": entry.voucher_detail_no, + "stock_uom": entry.stock_uom, "serial_nos": [], "sre_names": defaultdict(float), "batches": defaultdict(float), @@ -1402,6 +1403,7 @@ class StockReservation: sre.voucher_qty = entry.required_qty sre.item_code = entry.item_code sre.warehouse = entry.warehouse + sre.stock_uom = entry.stock_uom sre.reserved_qty = min(sre.available_qty, entry.qty) sre.has_serial_no = frappe.get_value("Item", sre.item_code, "has_serial_no") sre.has_batch_no = frappe.get_value("Item", sre.item_code, "has_batch_no")