[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.
This commit is contained in:
amoyaux
2017-10-19 13:33:15 +02:00
parent 11a3d100c3
commit 694436220f
+2 -2
View File
@@ -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(