From 8148067f59e2d0f41c93c422c5fc9c42a31bf4f0 Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 29 Mar 2023 16:04:31 +1100 Subject: [PATCH] Clear allocations when returning a stock item against a return order (#4538) --- InvenTree/order/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/InvenTree/order/models.py b/InvenTree/order/models.py index fb8b65e6e0..ac7499735e 100644 --- a/InvenTree/order/models.py +++ b/InvenTree/order/models.py @@ -1745,6 +1745,9 @@ class ReturnOrder(TotalPriceMixin, Order): stock_item = line.item + # Remove any allocations against the returned StockItem + stock_item.clearAllocations() + deltas = { 'status': StockStatus.QUARANTINED, 'returnorder': self.pk,