mirror of
https://github.com/inventree/InvenTree.git
synced 2026-02-06 13:25:53 +00:00
Location parameters (#11084)
* Add parameter support for StockLocation model * Serialize parameters for stock location * Frontend support * Bump API version --------- Co-authored-by: Matthias Mair <code@mjmair.com>
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
"""InvenTree API version information."""
|
||||
|
||||
# InvenTree API version
|
||||
INVENTREE_API_VERSION = 436
|
||||
INVENTREE_API_VERSION = 437
|
||||
"""Increment this API version number whenever there is a significant change to the API that any clients need to know about."""
|
||||
|
||||
INVENTREE_API_TEXT = """
|
||||
|
||||
v437 -> 2026-01-07 : https://github.com/inventree/InvenTree/pull/11084
|
||||
- Add generic parameter support for the StockLocation model
|
||||
|
||||
v436 -> 2026-01-06 : https://github.com/inventree/InvenTree/pull/11035
|
||||
- Removes model-specific metadata endpoints and replaces them with redirects
|
||||
- Adds new generic /api/metadata/<model_name>/ endpoint to retrieve metadata for any model
|
||||
|
||||
@@ -120,6 +120,7 @@ class StockLocationReportContext(report.mixins.BaseReportContext):
|
||||
|
||||
class StockLocation(
|
||||
InvenTree.models.PluginValidationMixin,
|
||||
InvenTree.models.InvenTreeParameterMixin,
|
||||
InvenTree.models.InvenTreeBarcodeMixin,
|
||||
report.mixins.InvenTreeReportMixin,
|
||||
InvenTree.models.PathStringMixin,
|
||||
|
||||
@@ -1159,8 +1159,10 @@ class LocationSerializer(
|
||||
'structural',
|
||||
'external',
|
||||
'location_type',
|
||||
# Optional fields
|
||||
'location_type_detail',
|
||||
'tags',
|
||||
'parameters',
|
||||
]
|
||||
read_only_fields = ['barcode_hash', 'icon', 'level', 'pathstring']
|
||||
|
||||
@@ -1205,6 +1207,8 @@ class LocationSerializer(
|
||||
filter_name='path_detail',
|
||||
)
|
||||
|
||||
parameters = common.filters.enable_parameters_filter()
|
||||
|
||||
# explicitly set this field, so it gets included for AutoSchema
|
||||
icon = serializers.CharField(read_only=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user