diff --git a/addons/sale_stock/models/sale_order.py b/addons/sale_stock/models/sale_order.py index db97bab288d..3ead29edd4e 100644 --- a/addons/sale_stock/models/sale_order.py +++ b/addons/sale_stock/models/sale_order.py @@ -340,11 +340,13 @@ class SaleOrderLine(models.Model): line.free_qty_today = free_qty_today - qty_processed_per_product[line.product_id.id] line.virtual_available_at_date = virtual_available_at_date - qty_processed_per_product[line.product_id.id] line.forecast_expected_date = False + product_qty = line.product_uom_qty if line.product_uom and line.product_id.uom_id and line.product_uom != line.product_id.uom_id: line.qty_available_today = line.product_id.uom_id._compute_quantity(line.qty_available_today, line.product_uom) line.free_qty_today = line.product_id.uom_id._compute_quantity(line.free_qty_today, line.product_uom) line.virtual_available_at_date = line.product_id.uom_id._compute_quantity(line.virtual_available_at_date, line.product_uom) - qty_processed_per_product[line.product_id.id] += line.product_uom_qty + product_qty = line.product_uom._compute_quantity(product_qty, line.product_id.uom_id) + qty_processed_per_product[line.product_id.id] += product_qty treated |= lines remaining = (self - treated) remaining.virtual_available_at_date = False