[FIX] stock_move_location: prevent putaway rules when we don't need them

If we disable in the wizard the "Apply putaway rules" toggle we wan't to
prevent those to be applied by any automatic logic. Simply injecting the
avoid_putaway_rules context the core does so ignoring them.

TT52561
This commit is contained in:
David
2025-01-10 16:43:07 +01:00
parent aa506fef86
commit dd0bfe2c2f

View File

@@ -266,6 +266,10 @@ class StockMoveLocationWizard(models.TransientModel):
picking = self._create_picking() picking = self._create_picking()
else: else:
picking = self.picking_id picking = self.picking_id
# Prevent putaway rules to be excuted when we don't need to
picking = picking.with_context(
avoid_putaway_rules=not self.apply_putaway_strategy
)
self._create_moves(picking) self._create_moves(picking)
if not self.env.context.get("planned"): if not self.env.context.get("planned"):
moves_to_reassign = self._unreserve_moves() moves_to_reassign = self._unreserve_moves()