mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-03 17:54:38 +00:00
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 5991ecfa3d)
This commit is contained in:
committed by
Mihir Kandoi
parent
336970aa5a
commit
e321e95e59
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user