diff --git a/mrp_multi_level/models/product_mrp_area.py b/mrp_multi_level/models/product_mrp_area.py index 9682381dd3..6a4bffd5cf 100644 --- a/mrp_multi_level/models/product_mrp_area.py +++ b/mrp_multi_level/models/product_mrp_area.py @@ -313,3 +313,7 @@ def _to_be_exploded(self): def _get_locations(self): self.ensure_one() return self.mrp_area_id._get_locations() + + def _should_create_planned_order(self): + self.ensure_one() + return True diff --git a/mrp_multi_level/wizards/mrp_multi_level.py b/mrp_multi_level/wizards/mrp_multi_level.py index a97eb98c50..9c933935c8 100644 --- a/mrp_multi_level/wizards/mrp_multi_level.py +++ b/mrp_multi_level/wizards/mrp_multi_level.py @@ -265,7 +265,9 @@ def create_planned_order( order_data = self._prepare_planned_order_data( product_mrp_area_id, qty, mrp_date_supply, mrp_action_date, name, values ) - planned_order = self.env["mrp.planned.order"].create(order_data) + planned_order = False + if product_mrp_area_id._should_create_planned_order(): + planned_order = self.env["mrp.planned.order"].create(order_data) qty_ordered = qty_ordered + qty if product_mrp_area_id._to_be_exploded():