Skip to content

Commit

Permalink
[FIX] ddmrp: Add in qualified demand only moves with positive quantities
Browse files Browse the repository at this point in the history
  • Loading branch information
BernatPForgeFlow authored and ChrisOForgeFlow committed Feb 27, 2024
1 parent e4ba783 commit c4b5c14
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ddmrp/models/stock_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1663,13 +1663,15 @@ def _calc_qualified_demand(self, current_date=False):
if (
demand_by_days.get(date, 0.0) >= rec.order_spike_threshold
or date <= today
and demand_by_days.get(date, 0.0) > 0
):
qualified_demand += demand_by_days.get(date, 0.0)
else:
moves = moves.filtered(lambda x: x.date != date)
moves = moves.filtered(lambda x: x.date.date() != date)
if (
mrp_moves_by_days.get(date, 0.0) >= rec.order_spike_threshold
or date <= today
and mrp_moves_by_days.get(date, 0.0) > 0
):
qualified_demand += mrp_moves_by_days.get(date, 0.0)
else:
Expand Down

0 comments on commit c4b5c14

Please sign in to comment.