From d5dbc1b0720c4b66c3d78fecd762fdc91a9d02df Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sun, 12 May 2019 12:20:15 +1000 Subject: [PATCH] Display supplier part URL in table --- .../company/templates/company/detail_part.html | 13 ++++++++++++- InvenTree/part/serializers.py | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/InvenTree/company/templates/company/detail_part.html b/InvenTree/company/templates/company/detail_part.html index 63234b9eff..5d01f1b10e 100644 --- a/InvenTree/company/templates/company/detail_part.html +++ b/InvenTree/company/templates/company/detail_part.html @@ -74,7 +74,18 @@ sortable: true, field: 'MPN', title: 'MPN', - } + }, + { + field: 'URL', + title: 'URL', + formatter: function(value, row, index, field) { + if (value) { + return renderLink(value, value); + } else { + return ''; + } + } + }, ], url: "{% url 'api-part-supplier-list' %}" }); diff --git a/InvenTree/part/serializers.py b/InvenTree/part/serializers.py index d4cb5ac8aa..957bfa5951 100644 --- a/InvenTree/part/serializers.py +++ b/InvenTree/part/serializers.py @@ -145,6 +145,7 @@ class SupplierPartSerializer(serializers.ModelSerializer): 'SKU', 'manufacturer', 'MPN', + 'URL', ]