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