mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Include total stock in PartBrief serializer
This commit is contained in:
parent
a6f95c70aa
commit
d386c2a6f9
@ -379,7 +379,7 @@ class Part(models.Model):
|
||||
|
||||
total -= self.allocation_count
|
||||
|
||||
return total
|
||||
return max(total, 0)
|
||||
|
||||
def isStarredBy(self, user):
|
||||
""" Return True if this part has been starred by a particular user """
|
||||
|
@ -50,6 +50,7 @@ class PartBriefSerializer(serializers.ModelSerializer):
|
||||
'url',
|
||||
'full_name',
|
||||
'description',
|
||||
'total_stock',
|
||||
'available_stock',
|
||||
'image_url',
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user