mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[IMP] mrp_multi_level: do not create moves if not data
This improves extensibility, allowing to not create moves on certain situations by extending the prepare vals hook method.
This commit is contained in:
@@ -414,13 +414,15 @@ class MultiLevelMrp(models.TransientModel):
|
||||
move_data = self._prepare_mrp_move_data_from_stock_move(
|
||||
product_mrp_area, move, direction="in"
|
||||
)
|
||||
move_vals.append(move_data)
|
||||
if move_data:
|
||||
move_vals.append(move_data)
|
||||
if out_moves:
|
||||
for move in out_moves:
|
||||
move_data = self._prepare_mrp_move_data_from_stock_move(
|
||||
product_mrp_area, move, direction="out"
|
||||
)
|
||||
move_vals.append(move_data)
|
||||
if move_data:
|
||||
move_vals.append(move_data)
|
||||
mrp_move_obj.create(move_vals)
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user