fix: set bom details on disassembly; abs batch qty

(cherry picked from commit ab1fc22431)
This commit is contained in:
Smit Vora
2026-04-07 10:00:30 +05:30
committed by Mergify
parent eee6d7e566
commit 84d5b52483

View File

@@ -336,7 +336,7 @@ class StockEntry(StockController):
for batch_no, batch_qty in source_bundle["batch_nos"].items():
if qty_remaining <= 0:
break
alloc = min(flt(batch_qty) * scale_factor, qty_remaining)
alloc = min(abs(flt(batch_qty)) * scale_factor, qty_remaining)
batches[batch_no] = alloc
qty_remaining -= alloc
elif source_row.batch_no:
@@ -2163,6 +2163,7 @@ class StockEntry(StockController):
"type": source_row.type,
"is_legacy_scrap_item": source_row.is_legacy_scrap_item,
"bom_secondary_item": source_row.bom_secondary_item,
"bom_no": source_row.bom_no,
# batch and serial bundles built on submit
"use_serial_batch_fields": 1 if (source_row.batch_no or source_row.serial_no) else 0,
}
@@ -2273,6 +2274,7 @@ class StockEntry(StockController):
SED.use_serial_batch_fields,
SED.s_warehouse,
SED.t_warehouse,
SED.bom_no,
]
if stock_entry: