Merge remote-tracking branch 'inventree/master'

This commit is contained in:
Oliver Walters 2020-05-27 09:31:15 +10:00
commit d0b3e0bd7c
3 changed files with 4 additions and 4 deletions

View File

@ -18,7 +18,7 @@
<a href="{% url 'part-stock' part.id %}">{% trans "Stock" %} <span class="badge">{% decimal part.total_stock %}</span></a>
</li>
{% endif %}
{% if part.component or part.used_in_count > 0 %}
{% if part.component or part.salable or part.used_in_count > 0 %}
<li{% ifequal tab 'allocation' %} class="active"{% endifequal %}>
<a href="{% url 'part-allocation' part.id %}">{% trans "Allocated" %} <span class="badge">{% decimal part.allocation_count %}</span></a>
</li>

View File

@ -74,6 +74,6 @@ class BarcodePlugin(plugin.InvenTreePlugin):
Use the existing serializer to do this
"""
serializer = StockItemSerializer(item, part_detail=True, location_detail=True, supplier_detail=True)
serializer = StockItemSerializer(item, part_detail=True, location_detail=True, supplier_part_detail=True)
return serializer.data

View File

@ -104,10 +104,10 @@ class StockItemSerializer(InvenTreeModelSerializer):
location_detail = LocationBriefSerializer(source='location', many=False, read_only=True)
supplier_part_detail = SupplierPartSerializer(source='supplier_part', many=False, read_only=True)
tracking_items = serializers.IntegerField()
tracking_items = serializers.IntegerField(source='tracking_info_count')
quantity = serializers.FloatField()
allocated = serializers.FloatField()
allocated = serializers.FloatField(source='allocation_count')
required_tests = serializers.IntegerField(source='required_test_count', read_only=True)