Skip to content

Commit

Permalink
[FIX] mrp_multi_level: readd extensibility hook
Browse files Browse the repository at this point in the history
_should_create_planned_order hook was unnoticely removed in
33cf4af as it was not needed
anymore in the base module. However it is still an extension point
that can be used.
  • Loading branch information
LoisRForgeFlow committed Nov 12, 2024
1 parent 61079fb commit 1c49c1f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions mrp_multi_level/models/product_mrp_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion mrp_multi_level/wizards/mrp_multi_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 1c49c1f

Please sign in to comment.