Skip to content

Commit

Permalink
[IMP] stock_picking_putaway_recompute: Apply first the move destinati…
Browse files Browse the repository at this point in the history
…on location

This is more correct as the original location before applying
the putaways is the stock move destination location.
  • Loading branch information
rousseldenis committed Nov 22, 2024
1 parent ff1b4bf commit e4f0447
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion stock_picking_putaway_recompute/models/stock_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ def _recompute_putaways(self) -> None:
Launches the computation of putaways on operations that are
allowed to.
"""
self._filtered_for_putaway_recompute()._apply_putaway_strategy()
to_recompute_lines = self._filtered_for_putaway_recompute()
# Reset location destinations to their move destination
# First, protect the field from recomputations as
# value will be reaffected afterwards.
with to_recompute_lines.env.protecting(["location_dest_id"],to_recompute_lines):
for line in to_recompute_lines:
line.location_dest_id = line.move_id.location_dest_id
to_recompute_lines._apply_putaway_strategy()

def action_recompute_putaways(self):
self._recompute_putaways()

0 comments on commit e4f0447

Please sign in to comment.