From ae2bfc06ee6d028db8507f479afba4af0d4458d9 Mon Sep 17 00:00:00 2001 From: sbejaoui Date: Tue, 4 Jul 2023 11:00:46 +0200 Subject: [PATCH] [FIX] - plan only ready moves --- shipment_advice_planner/wizards/shipment_advice_planner.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shipment_advice_planner/wizards/shipment_advice_planner.py b/shipment_advice_planner/wizards/shipment_advice_planner.py index 084b62d5..959ad071 100644 --- a/shipment_advice_planner/wizards/shipment_advice_planner.py +++ b/shipment_advice_planner/wizards/shipment_advice_planner.py @@ -139,7 +139,11 @@ def _get_picking_to_plan_by_picking_type(self): def _prepare_shipment_advice_simple_vals_list(self, picking_type, pickings_to_plan): self.ensure_one() vals = self._prepare_shipment_advice_common_vals(picking_type) - vals["planned_move_ids"] = [Command.set(pickings_to_plan.move_ids.ids)] + moves_to_plan = pickings_to_plan.move_ids.filtered( + lambda m: m.state in ("assigned", "partially_available") + ) + if moves_to_plan: + vals["planned_move_ids"] = [Command.set(moves_to_plan.ids)] return [vals] def _prepare_shipment_advice_common_vals(self, picking_type):