2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-02 03:30:54 +00:00

Build API improvements (#3581)

* Improve build order lookup

* Query efficiency improvements

* Lazy load build allocation table

* API defaults ensure consistent behaviour
This commit is contained in:
Oliver
2022-08-19 17:16:38 +10:00
committed by GitHub
parent 89d5df4f1e
commit b886e54709
5 changed files with 24 additions and 11 deletions

View File

@ -856,6 +856,7 @@ class BuildItemSerializer(InvenTreeModelSerializer):
build_detail = kwargs.pop('build_detail', False)
part_detail = kwargs.pop('part_detail', False)
location_detail = kwargs.pop('location_detail', False)
stock_detail = kwargs.pop('stock_detail', False)
super().__init__(*args, **kwargs)
@ -868,6 +869,9 @@ class BuildItemSerializer(InvenTreeModelSerializer):
if not location_detail:
self.fields.pop('location_detail')
if not stock_detail:
self.fields.pop('stock_item_detail')
class Meta:
"""Serializer metaclass"""
model = BuildItem