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:
@@ -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'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user