mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Display number of supplier parts in supplier list
This commit is contained in:
parent
5ebc7b040a
commit
b77b6d2256
@ -25,7 +25,25 @@ class CompanySerializer(serializers.ModelSerializer):
|
||||
""" Serializer for Company object (full detail) """
|
||||
|
||||
url = serializers.CharField(source='get_absolute_url', read_only=True)
|
||||
part_count = serializers.CharField(read_only=True)
|
||||
|
||||
class Meta:
|
||||
model = Company
|
||||
fields = '__all__'
|
||||
fields = [
|
||||
'id',
|
||||
'url',
|
||||
'name',
|
||||
'description',
|
||||
'website',
|
||||
'name',
|
||||
'phone',
|
||||
'address',
|
||||
'email',
|
||||
'contact',
|
||||
'URL',
|
||||
'image',
|
||||
'notes',
|
||||
'is_customer',
|
||||
'is_supplier',
|
||||
'part_count'
|
||||
]
|
||||
|
@ -73,7 +73,14 @@ InvenTree | Supplier List
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'part_count',
|
||||
title: 'Parts',
|
||||
formatter: function(value, row, index, field) {
|
||||
return renderLink(value, row.url + 'parts/');
|
||||
}
|
||||
},
|
||||
],
|
||||
url: "{% url 'api-company-list' %}"
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user