mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 11:36:44 +00:00
* [Bug] Fix search for StockTrackingList - Removed invalid field * Add unit test coverage for failing condition * Fix 'notes' field for extra line item API (cherry picked from commit 21ae1138ceae4ec85546a6982b1d4d621b94ed77) Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
parent
053b37ec3a
commit
b18ac57fb8
@ -68,9 +68,9 @@ class GeneralExtraLineList(DataExportViewMixin):
|
|||||||
|
|
||||||
filter_backends = SEARCH_ORDER_FILTER
|
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']
|
filterset_fields = ['order']
|
||||||
|
|
||||||
|
@ -1461,7 +1461,7 @@ class StockTrackingList(DataExportViewMixin, ListAPI):
|
|||||||
|
|
||||||
ordering_fields = ['date']
|
ordering_fields = ['date']
|
||||||
|
|
||||||
search_fields = ['title', 'notes']
|
search_fields = ['notes']
|
||||||
|
|
||||||
|
|
||||||
class LocationDetail(CustomRetrieveUpdateDestroyAPI):
|
class LocationDetail(CustomRetrieveUpdateDestroyAPI):
|
||||||
|
@ -2150,6 +2150,11 @@ class StockTrackingTest(StockAPITestCase):
|
|||||||
response = self.get(url, {'limit': 1})
|
response = self.get(url, {'limit': 1})
|
||||||
self.assertEqual(response.data['count'], N)
|
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):
|
def test_list(self):
|
||||||
"""Test list endpoint."""
|
"""Test list endpoint."""
|
||||||
url = self.get_url()
|
url = self.get_url()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user