From 1adc42d422e69a225c57f534d07724de23f39064 Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 11 Dec 2024 15:44:00 +1100 Subject: [PATCH] Filter fix (#8652) * Allow ordering by IPN * Update table --- src/backend/InvenTree/order/api.py | 2 ++ .../src/tables/purchasing/PurchaseOrderLineItemTable.tsx | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/backend/InvenTree/order/api.py b/src/backend/InvenTree/order/api.py index dbbe60c0b814..e9111f328463 100644 --- a/src/backend/InvenTree/order/api.py +++ b/src/backend/InvenTree/order/api.py @@ -580,6 +580,7 @@ def create(self, request, *args, **kwargs): ordering_field_aliases = { 'MPN': 'part__manufacturer_part__MPN', 'SKU': 'part__SKU', + 'IPN': 'part__part__IPN', 'part_name': 'part__part__name', 'order': 'order__reference', 'status': 'order__status', @@ -594,6 +595,7 @@ def create(self, request, *args, **kwargs): 'received', 'reference', 'SKU', + 'IPN', 'total_price', 'target_date', 'order', diff --git a/src/frontend/src/tables/purchasing/PurchaseOrderLineItemTable.tsx b/src/frontend/src/tables/purchasing/PurchaseOrderLineItemTable.tsx index 54cacac4bdd8..c12ac9af1cb8 100644 --- a/src/frontend/src/tables/purchasing/PurchaseOrderLineItemTable.tsx +++ b/src/frontend/src/tables/purchasing/PurchaseOrderLineItemTable.tsx @@ -129,12 +129,14 @@ export function PurchaseOrderLineItemTable({ accessor: 'part', title: t`Part`, sortable: true, + ordering: 'part_name', switchable: false, render: (record: any) => PartColumn({ part: record.part_detail }) }, { accessor: 'part_detail.IPN', - sortable: false + sortable: true, + ordering: 'IPN' }, { accessor: 'part_detail.description',