From 6b73e7a408c4698d09232fb39ada8c493513f342 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 9 Jul 2021 14:28:32 +1000 Subject: [PATCH] Add more fields to ManufacturerPart and SupplierPart tables --- InvenTree/company/serializers.py | 19 +++++++++++-------- InvenTree/templates/js/company.js | 21 +++++++++++++++++++++ 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/InvenTree/company/serializers.py b/InvenTree/company/serializers.py index 276225624f..6e5ef08d6e 100644 --- a/InvenTree/company/serializers.py +++ b/InvenTree/company/serializers.py @@ -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): diff --git a/InvenTree/templates/js/company.js b/InvenTree/templates/js/company.js index d28bca5547..18d7408b23 100644 --- a/InvenTree/templates/js/company.js +++ b/InvenTree/templates/js/company.js @@ -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, + } ], }); } \ No newline at end of file