diff --git a/stock_auto_move/models/stock_move.py b/stock_auto_move/models/stock_move.py index bd483690c754..d217da7ec34f 100644 --- a/stock_auto_move/models/stock_move.py +++ b/stock_auto_move/models/stock_move.py @@ -30,10 +30,17 @@ def _get_auto_moves_by_pickings(self, auto_moves): @api.multi def action_assign(self, no_prepare=False): - res = super(StockMove, self).action_assign(no_prepare=no_prepare) - # Select auto moves that are assigned - auto_moves = self.filtered( + already_assigned_moves = self.filtered( + lambda m: m.state == 'assigned') + + not_assigned_auto_move = self - already_assigned_moves + + res = super(StockMove, self).action_assign( + no_prepare=no_prepare) + + # Process only moves that have been processed recently + auto_moves = not_assigned_auto_move.filtered( lambda m: m.state == 'assigned' and m.auto_move) # group the moves by pickings