From ccaece3634e4fd6559b2bd23e5dfd98c7bfd2703 Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 17 Oct 2023 21:21:13 +1100 Subject: [PATCH] Remove StockItemManager class (#5727) - Not used anywhere - Reference: https://github.com/inventree/InvenTree/issues/5586 --- InvenTree/stock/models.py | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/InvenTree/stock/models.py b/InvenTree/stock/models.py index ce71685923..ad94690519 100644 --- a/InvenTree/stock/models.py +++ b/InvenTree/stock/models.py @@ -301,30 +301,6 @@ class StockLocation(InvenTreeBarcodeMixin, MetadataMixin, InvenTreeTree): return self.stock_item_count() -class StockItemManager(TreeManager): - """Custom database manager for the StockItem class. - - StockItem querysets will automatically prefetch related fields. - """ - - def get_queryset(self): - """Prefetch queryset to optimise db hits.""" - return super().get_queryset().prefetch_related( - 'belongs_to', - 'build', - 'customer', - 'purchase_order', - 'sales_order', - 'supplier_part', - 'supplier_part__supplier', - 'allocations', - 'sales_order_allocations', - 'location', - 'part', - 'tracking_info' - ) - - def generate_batch_code(): """Generate a default 'batch code' for a new StockItem.