mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 19:20:55 +00:00
Schema: Add possible order fields to 'ordering' field description (#9803)
* Make optional build order reference nullable * Add valid choices to ordering field description * Bump API version
This commit is contained in:
@ -1,11 +1,14 @@
|
|||||||
"""InvenTree API version information."""
|
"""InvenTree API version information."""
|
||||||
|
|
||||||
# InvenTree API version
|
# InvenTree API version
|
||||||
INVENTREE_API_VERSION = 351
|
INVENTREE_API_VERSION = 352
|
||||||
|
|
||||||
"""Increment this API version number whenever there is a significant change to the API that any clients need to know about."""
|
"""Increment this API version number whenever there is a significant change to the API that any clients need to know about."""
|
||||||
|
|
||||||
INVENTREE_API_TEXT = """
|
INVENTREE_API_TEXT = """
|
||||||
|
v352 -> 2025-06-18 : https://github.com/inventree/InvenTree/pull/9803
|
||||||
|
- Make PurchaseOrderLineItem link to BuildOrder reference nullable
|
||||||
|
- Add valid fields to ordering field descriptions
|
||||||
|
|
||||||
v351 -> 2025-06-18 : https://github.com/inventree/InvenTree/pull/9602
|
v351 -> 2025-06-18 : https://github.com/inventree/InvenTree/pull/9602
|
||||||
- Adds passwort reset API endpoint for admin users
|
- Adds passwort reset API endpoint for admin users
|
||||||
|
@ -91,6 +91,16 @@ class ExtendedAutoSchema(AutoSchema):
|
|||||||
if parameter['name'] == 'limit':
|
if parameter['name'] == 'limit':
|
||||||
parameter['required'] = True
|
parameter['required'] = True
|
||||||
|
|
||||||
|
# Add valid order selections to the ordering field description.
|
||||||
|
ordering_fields = getattr(self.view, 'ordering_fields', None)
|
||||||
|
if ordering_fields is not None:
|
||||||
|
parameters = operation.get('parameters', [])
|
||||||
|
for parameter in parameters:
|
||||||
|
if parameter['name'] == 'ordering':
|
||||||
|
parameter['description'] = (
|
||||||
|
f'{parameter["description"]} Possible fields: {", ".join(ordering_fields)}.'
|
||||||
|
)
|
||||||
|
|
||||||
return operation
|
return operation
|
||||||
|
|
||||||
|
|
||||||
|
@ -649,7 +649,7 @@ class PurchaseOrderLineItemSerializer(
|
|||||||
)
|
)
|
||||||
|
|
||||||
build_order_detail = build.serializers.BuildSerializer(
|
build_order_detail = build.serializers.BuildSerializer(
|
||||||
source='build_order', read_only=True, many=False
|
source='build_order', read_only=True, allow_null=True, many=False
|
||||||
)
|
)
|
||||||
|
|
||||||
merge_items = serializers.BooleanField(
|
merge_items = serializers.BooleanField(
|
||||||
|
Reference in New Issue
Block a user