2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-12-17 17:58:22 +00:00

[API] Improvements for API endpoints (#7794)

* Build allocation API updates

- Improve API query efficiency
- Add extra export fields to the BuildItemSerializer

* Remove commented code

* Improve query efficiency for BuildLine serializer

* Further improvements

* Improve StockList API endpoint

- Reduce from ~700ms to ~300ms with 250 results

* Improve query efficiency when fetching part parameter data

* Bump API version
This commit is contained in:
Oliver
2024-08-03 16:13:38 +10:00
committed by GitHub
parent 85fc709fc7
commit dee519e848
6 changed files with 53 additions and 11 deletions

View File

@@ -381,9 +381,14 @@ class SupplierPartSerializer(
self.fields.pop('manufacturer_detail', None)
self.fields.pop('manufacturer_part_detail', None)
if prettify is not True:
if brief or prettify is not True:
self.fields.pop('pretty_name', None)
if brief:
self.fields.pop('tags')
self.fields.pop('available')
self.fields.pop('availability_updated')
# Annotated field showing total in-stock quantity
in_stock = serializers.FloatField(read_only=True, label=_('In Stock'))