2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-13 08:21:26 +00:00

Expose "is_allocated" parameter on StockItem API

This commit is contained in:
Oliver Walters
2020-04-22 10:11:40 +10:00
parent 12daf15406
commit 6dd79af0b6
7 changed files with 68 additions and 2 deletions

View File

@ -90,6 +90,8 @@ class StockItemSerializer(InvenTreeModelSerializer):
tracking_items = serializers.IntegerField(source='tracking_info_count', read_only=True)
allocated = serializers.BooleanField(source='is_allocated', read_only=True)
def __init__(self, *args, **kwargs):
part_detail = kwargs.pop('part_detail', False)
@ -110,6 +112,7 @@ class StockItemSerializer(InvenTreeModelSerializer):
class Meta:
model = StockItem
fields = [
'allocated',
'batch',
'in_stock',
'link',