mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +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
|
total -= self.allocation_count
|
||||||
|
|
||||||
return total
|
return max(total, 0)
|
||||||
|
|
||||||
def isStarredBy(self, user):
|
def isStarredBy(self, user):
|
||||||
""" Return True if this part has been starred by a particular user """
|
""" Return True if this part has been starred by a particular user """
|
||||||
|
@ -50,6 +50,7 @@ class PartBriefSerializer(serializers.ModelSerializer):
|
|||||||
'url',
|
'url',
|
||||||
'full_name',
|
'full_name',
|
||||||
'description',
|
'description',
|
||||||
|
'total_stock',
|
||||||
'available_stock',
|
'available_stock',
|
||||||
'image_url',
|
'image_url',
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user