Add more fields to ManufacturerPart and SupplierPart tables

This commit is contained in:
Oliver 2021-07-09 14:28:32 +10:00
parent 5235ad1b0c
commit 6b73e7a408
2 changed files with 32 additions and 8 deletions

View File

@ -206,24 +206,27 @@ class SupplierPartSerializer(InvenTreeModelSerializer):
MPN = serializers.StringRelatedField(source='manufacturer_part.MPN')
manufacturer_part = ManufacturerPartSerializer(read_only=True)
manufacturer_part_detail = ManufacturerPartSerializer(source='manufacturer_part', read_only=True)
class Meta:
model = SupplierPart
fields = [
'description',
'link',
'manufacturer',
'manufacturer_detail',
'manufacturer_part',
'manufacturer_part_detail',
'MPN',
'note',
'pk',
'packaging',
'part',
'part_detail',
'pretty_name',
'SKU',
'supplier',
'supplier_detail',
'SKU',
'manufacturer',
'MPN',
'manufacturer_detail',
'manufacturer_part',
'description',
'link',
]
def create(self, validated_data):

View File

@ -318,6 +318,12 @@ function loadManufacturerPartTable(table, url, options) {
}
}
},
{
field: 'description',
title: '{% trans "Description" %}',
sortable: false,
switchable: true,
}
],
});
}
@ -550,6 +556,21 @@ function loadSupplierPartTable(table, url, options) {
}
}
},
{
field: 'description',
title: '{% trans "Description" %}',
sortable: false,
},
{
field: 'note',
title: '{% trans "Notes" %}',
sortable: false,
},
{
field: 'packaging',
title: '{% trans "Packaging" %}',
sortable: false,
}
],
});
}