fix: do not round up finished good qty for whole number UOM

The manufacture stock entry silently ceiled the finished good qty when
the item's stock UOM has Must be Whole Number set, booking more produced
stock than the fg_completed_qty requested (e.g. 0.286 became 1). Keep
the computed qty as is; validate_uom_is_integer already rejects a
fractional qty with a clear error on save. The ceil stays in place for
backflushed raw material rows, which was its original purpose.
This commit is contained in:
Mihir Kandoi
2026-08-20 21:22:09 +05:30
parent 624d402143
commit c2031798b6

View File

@@ -163,7 +163,7 @@ class BaseManufactureStockEntry(BaseStockEntry):
{
"conversion_factor": 1,
"uom": item_details.stock_uom,
"qty": ceil_qty_if_uom_has_whole_number(fg_item_qty, item_details.stock_uom),
"qty": fg_item_qty,
"t_warehouse": self.doc.to_warehouse
or frappe.get_cached_value("BOM", self.doc.bom_no, "default_target_warehouse"),
"s_warehouse": None,