[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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user