mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-03 22:55:43 +00:00 
			
		
		
		
	Tracking api fix (#9238)
* [Bug] Fix search for StockTrackingList - Removed invalid field * Add unit test coverage for failing condition * Fix 'notes' field for extra line item API
This commit is contained in:
		@@ -69,9 +69,9 @@ class GeneralExtraLineList(DataExportViewMixin):
 | 
			
		||||
 | 
			
		||||
    filter_backends = SEARCH_ORDER_FILTER
 | 
			
		||||
 | 
			
		||||
    ordering_fields = ['quantity', 'note', 'reference']
 | 
			
		||||
    ordering_fields = ['quantity', 'notes', 'reference']
 | 
			
		||||
 | 
			
		||||
    search_fields = ['quantity', 'note', 'reference', 'description']
 | 
			
		||||
    search_fields = ['quantity', 'notes', 'reference', 'description']
 | 
			
		||||
 | 
			
		||||
    filterset_fields = ['order']
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1495,7 +1495,7 @@ class StockTrackingList(DataExportViewMixin, ListAPI):
 | 
			
		||||
 | 
			
		||||
    ordering_fields = ['date']
 | 
			
		||||
 | 
			
		||||
    search_fields = ['title', 'notes']
 | 
			
		||||
    search_fields = ['notes']
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
stock_api_urls = [
 | 
			
		||||
 
 | 
			
		||||
@@ -2177,6 +2177,11 @@ class StockTrackingTest(StockAPITestCase):
 | 
			
		||||
        response = self.get(url, {'limit': 1})
 | 
			
		||||
        self.assertEqual(response.data['count'], N)
 | 
			
		||||
 | 
			
		||||
        # Test with search and pagination
 | 
			
		||||
        response = self.get(url, {'limit': 1, 'offset': 10, 'search': 'berries'})
 | 
			
		||||
 | 
			
		||||
        self.assertEqual(response.data['count'], 0)
 | 
			
		||||
 | 
			
		||||
    def test_list(self):
 | 
			
		||||
        """Test list endpoint."""
 | 
			
		||||
        url = self.get_url()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user