Skip to content

Commit

Permalink
Merge PR #440 into 15.0
Browse files Browse the repository at this point in the history
Signed-off-by LoisRForgeFlow
  • Loading branch information
OCA-git-bot committed May 2, 2024
2 parents 8adf752 + 617acd8 commit 6e9c358
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ddmrp/models/stock_buffer.py
Expand Up @@ -1770,6 +1770,7 @@ def write(self, vals):
def _procure_qty_to_order(self):
qty_to_order = self.procure_recommended_qty
rounding = self.procure_uom_id.rounding or self.product_uom.rounding
qty_in_progress = self._quantity_in_progress()[self._origin.id]
if (
self.item_type == "distributed"
and self.buffer_profile_id.replenish_distributed_limit_to_free_qty
Expand All @@ -1790,6 +1791,16 @@ def _procure_qty_to_order(self):
else:
# move only what we have in stock
return min(qty_to_order, self.distributed_source_location_qty)
elif (
float_compare(qty_in_progress, 0, precision_rounding=rounding) > 0
and float_compare(
qty_to_order, self.green_zone_qty, precision_rounding=rounding
)
< 0
):
# When there is qty in progress (e.g. RfQ sent), do not keep
# auto-procuring small quantities, wait for the qty to be at least GZ.
return 0
return qty_to_order

def do_auto_procure(self):
Expand Down

0 comments on commit 6e9c358

Please sign in to comment.