From 694436220f53635815103449e88dedd5efd7acaa Mon Sep 17 00:00:00 2001 From: amoyaux Date: Thu, 19 Oct 2017 11:21:52 +0200 Subject: [PATCH] [FIX] stock: put in pack with UOM When put a quantity in a pack the reserved quantity is split between the original move line and the move line for the pack. However in order to compute the quantity left to do. The system compare the quantity reserved in term of quant UOM and the quantity done with the move line UOM. This commit compare both fields in move_line's UOM. --- addons/stock/models/stock_picking.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock/models/stock_picking.py b/addons/stock/models/stock_picking.py index 33faf25e3b7..7a67e07b1cb 100644 --- a/addons/stock/models/stock_picking.py +++ b/addons/stock/models/stock_picking.py @@ -788,11 +788,11 @@ class Picking(models.Model): if operations: package = self.env['stock.quant.package'].create({}) for operation in operations: - if float_compare(operation.qty_done, operation.product_qty, precision_rounding=operation.product_uom_id.rounding) >= 0: + if float_compare(operation.qty_done, operation.product_uom_qty, precision_rounding=operation.product_uom_id.rounding) >= 0: operation_ids |= operation else: quantity_left_todo = float_round( - operation.product_qty - operation.qty_done, + operation.product_uom_qty - operation.qty_done, precision_rounding=operation.product_uom_id.rounding, rounding_method='UP') new_operation = operation.copy(