mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-03 22:55:43 +00:00 
			
		
		
		
	Only display "outstanding" sales order allocations in table
This commit is contained in:
		@@ -886,9 +886,15 @@ class SOAllocationList(generics.ListAPIView):
 | 
				
			|||||||
            outstanding = str2bool(outstanding)
 | 
					            outstanding = str2bool(outstanding)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if outstanding:
 | 
					            if outstanding:
 | 
				
			||||||
                queryset = queryset.filter(line__order__status__in=SalesOrderStatus.OPEN)
 | 
					                # Filter only "open" orders
 | 
				
			||||||
 | 
					                # Filter only allocations which have *not* shipped
 | 
				
			||||||
 | 
					                queryset = queryset.filter(
 | 
				
			||||||
 | 
					                    line__order__status__in=SalesOrderStatus.OPEN,
 | 
				
			||||||
 | 
					                    shipment__shipment_date=None,
 | 
				
			||||||
 | 
					                )
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
                queryset = queryset.exclude(line__order__status__in=SalesOrderStatus.OPEN)
 | 
					                queryset = queryset.exclude(line__order__status__in=SalesOrderStatus.OPEN)
 | 
				
			||||||
 | 
					                queryset = queryset.exclude(shipment__shipment_date=None)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return queryset
 | 
					        return queryset
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2353,6 +2353,10 @@ function loadStockAllocationTable(table, options={}) {
 | 
				
			|||||||
            query_params.customer_detail = true;
 | 
					            query_params.customer_detail = true;
 | 
				
			||||||
            query_params.order_detail = true;
 | 
					            query_params.order_detail = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            // Note: SalesOrderAllocations do not get deleted,
 | 
				
			||||||
 | 
					            // so we must filter by "outstanding" status
 | 
				
			||||||
 | 
					            query_params.outstanding = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            delete query_params.build_detail;
 | 
					            delete query_params.build_detail;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // Load sales order allocation data
 | 
					            // Load sales order allocation data
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user