Skip to content

Commit

Permalink
Merge PR #439 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by LoisRForgeFlow
  • Loading branch information
OCA-git-bot committed Apr 29, 2024
2 parents 9de0f7e + 5b6a9f3 commit 2e70eb0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ddmrp/models/stock_buffer.py
Expand Up @@ -1781,6 +1781,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 @@ -1801,6 +1802,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 2e70eb0

Please sign in to comment.