Skip to content

Commit

Permalink
[FIX] Lost pack operation link with stock move when splitting
Browse files Browse the repository at this point in the history
When we want to split pack operation quantities, the resulting pack operation
does not contain the link with corresponding stock_move.
Recomputing remaining quantities fixes that issue.
  • Loading branch information
rousseldenis committed Apr 24, 2017
1 parent 07c563e commit 9750880
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions addons/stock/models/stock_pack_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ def split_quantities(self):
cpy = operation.copy(default={'qty_done': 0.0, 'product_qty': operation.product_qty - operation.qty_done})
operation.write({'product_qty': operation.qty_done})
operation._copy_remaining_pack_lot_ids(cpy)
if operation.picking_id:
operation.picking_id.recompute_remaining_qty()
else:
raise UserError(_('The quantity to split should be smaller than the quantity To Do. '))
return True
Expand Down

0 comments on commit 9750880

Please sign in to comment.