2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 04:25:42 +00:00

PUI tweaks (#7144)

* Default progress bars a bit thicker

* Implement useFilters hook

- Adds "project code" filter for order tables

* Add "responsible" filters to backend

* Add more filters to tables

* Bump API version

* Typo fix

* Tweak PartTable

* Tweaks

* remove unused imports
This commit is contained in:
Oliver
2024-04-30 16:21:38 +10:00
committed by GitHub
parent 1ef9512f18
commit a9b932cc32
12 changed files with 226 additions and 45 deletions

View File

@ -1,11 +1,14 @@
"""InvenTree API version information."""
# InvenTree API version
INVENTREE_API_VERSION = 192
INVENTREE_API_VERSION = 193
"""Increment this API version number whenever there is a significant change to the API that any clients need to know about."""
INVENTREE_API_TEXT = """
v193 - 2024-04-30 : https://github.com/inventree/InvenTree/pull/7144
- Adds "assigned_to" filter to PurchaseOrder / SalesOrder / ReturnOrder API endpoints
v192 - 2024-04-23 : https://github.com/inventree/InvenTree/pull/7106
- Adds 'trackable' ordering option to BuildLineLabel API endpoint

View File

@ -148,6 +148,10 @@ class OrderFilter(rest_filters.FilterSet):
return queryset.exclude(project_code=None)
return queryset.filter(project_code=None)
assigned_to = rest_filters.ModelChoiceFilter(
queryset=Owner.objects.all(), field_name='responsible'
)
class LineItemFilter(rest_filters.FilterSet):
"""Base class for custom API filters for order line item list(s)."""

View File

@ -77,16 +77,18 @@ class AbstractOrderSerializer(serializers.Serializer):
"""Abstract serializer class which provides fields common to all order types."""
# Number of line items in this order
line_items = serializers.IntegerField(read_only=True)
line_items = serializers.IntegerField(read_only=True, label=_('Line Items'))
# Number of completed line items (this is an annotated field)
completed_lines = serializers.IntegerField(read_only=True)
completed_lines = serializers.IntegerField(
read_only=True, label=_('Completed Lines')
)
# Human-readable status text (read-only)
status_text = serializers.CharField(source='get_status_display', read_only=True)
# status field cannot be set directly
status = serializers.IntegerField(read_only=True)
status = serializers.IntegerField(read_only=True, label=_('Order Status'))
# Reference string is *required*
reference = serializers.CharField(required=True)
@ -114,7 +116,9 @@ class AbstractOrderSerializer(serializers.Serializer):
barcode_hash = serializers.CharField(read_only=True)
creation_date = serializers.DateField(required=False, allow_null=True)
creation_date = serializers.DateField(
required=False, allow_null=True, label=_('Creation Date')
)
def validate_reference(self, reference):
"""Custom validation for the reference field."""