From 80e47b6f766fdcd71c7496e7d5b12ddf95454290 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 20 Jun 2021 22:49:06 +0200 Subject: [PATCH] addd in sorting for category fixes #1689 --- InvenTree/part/api.py | 1 + InvenTree/templates/js/part.js | 1 + 2 files changed, 2 insertions(+) diff --git a/InvenTree/part/api.py b/InvenTree/part/api.py index c2785b666f..60cea121a7 100644 --- a/InvenTree/part/api.py +++ b/InvenTree/part/api.py @@ -706,6 +706,7 @@ class PartList(generics.ListCreateAPIView): 'creation_date', 'IPN', 'in_stock', + 'category', ] # Default ordering diff --git a/InvenTree/templates/js/part.js b/InvenTree/templates/js/part.js index 7331ec25e0..66174e2f15 100644 --- a/InvenTree/templates/js/part.js +++ b/InvenTree/templates/js/part.js @@ -447,6 +447,7 @@ function loadPartTable(table, url, options={}) { columns.push({ sortable: true, + sortName: 'category', field: 'category_detail', title: '{% trans "Category" %}', formatter: function(value, row, index, field) {