From abcdbbaf6c522139ad2e0ea0607158ef4bdea01e Mon Sep 17 00:00:00 2001 From: Johan De Taeye Date: Wed, 23 Oct 2024 18:14:09 +0200 Subject: [PATCH] small update to handle negative demand quantities more robust --- frepple/controllers/outbound.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frepple/controllers/outbound.py b/frepple/controllers/outbound.py index 3acc490..268d6dd 100644 --- a/frepple/controllers/outbound.py +++ b/frepple/controllers/outbound.py @@ -2060,7 +2060,7 @@ def getReservedQuantity(stock_move_id): ), due, priority, - j["picking_policy"] == "one" and qty or 0.0, + qty - reserved_quantity if j["picking_policy"] == "one" and qty - reserved_quantity > 0 else 0.0, "open" if qty - reserved_quantity > 0 else "closed", quoteattr(product["name"]), quoteattr(customer), @@ -2120,7 +2120,7 @@ def getReservedQuantity(stock_move_id): qty, due, priority, - j["picking_policy"] == "one" and qty or 0.0, + qty if j["picking_policy"] == "one" and qty > 0 else 0.0, status, quoteattr(product["name"]), quoteattr(customer),