From 2d9ca7c1b654062d804c7ddcda52b6ac08c09cf5 Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 28 Sep 2021 10:36:01 +1000 Subject: [PATCH] Do not rebuild the entire StockItem tree every time a single StockItem is deleted! --- InvenTree/stock/models.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/InvenTree/stock/models.py b/InvenTree/stock/models.py index 3344dec0eb..1372e63406 100644 --- a/InvenTree/stock/models.py +++ b/InvenTree/stock/models.py @@ -1650,9 +1650,6 @@ def before_delete_stock_item(sender, instance, using, **kwargs): child.parent = instance.parent child.save() - # Rebuild the MPTT tree - StockItem.objects.rebuild() - class StockItemAttachment(InvenTreeAttachment): """