mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-15 19:45:46 +00:00
Client-side grouping
- Cusomizations made to bootstrap-table-group-by.js - Group by part name - Display total stock count per group - Only group if there are more than 1 item in the group - Groups send checkbox signals through appropriately!
This commit is contained in:
@ -183,6 +183,9 @@ class StockItem(models.Model):
|
||||
def get_absolute_url(self):
|
||||
return reverse('stock-item-detail', kwargs={'pk': self.id})
|
||||
|
||||
def get_part_name(self):
|
||||
return self.part.full_name
|
||||
|
||||
class Meta:
|
||||
unique_together = [
|
||||
('part', 'serial'),
|
||||
|
@ -57,6 +57,8 @@ class StockItemSerializer(serializers.ModelSerializer):
|
||||
url = serializers.CharField(source='get_absolute_url', read_only=True)
|
||||
status_text = serializers.CharField(source='get_status_display', read_only=True)
|
||||
|
||||
part_name = serializers.CharField(source='get_part_name', read_only=True)
|
||||
|
||||
part_detail = PartBriefSerializer(source='part', many=False, read_only=True)
|
||||
location_detail = LocationBriefSerializer(source='location', many=False, read_only=True)
|
||||
|
||||
@ -79,6 +81,7 @@ class StockItemSerializer(serializers.ModelSerializer):
|
||||
'pk',
|
||||
'url',
|
||||
'part',
|
||||
'part_name',
|
||||
'part_detail',
|
||||
'supplier_part',
|
||||
'location',
|
||||
|
Reference in New Issue
Block a user