2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-01-28 17:13:44 +00:00

Sort by ipn (#11177)

* Enable sorting by IPN in BOM table

* Ordering by IPN in build line table

* Bump API version
This commit is contained in:
Oliver
2026-01-21 17:01:24 +11:00
committed by GitHub
parent fab61789e1
commit e025180242
5 changed files with 13 additions and 3 deletions

View File

@@ -1,11 +1,15 @@
"""InvenTree API version information.""" """InvenTree API version information."""
# InvenTree API version # InvenTree API version
INVENTREE_API_VERSION = 442 INVENTREE_API_VERSION = 443
"""Increment this API version number whenever there is a significant change to the API that any clients need to know about.""" """Increment this API version number whenever there is a significant change to the API that any clients need to know about."""
INVENTREE_API_TEXT = """ INVENTREE_API_TEXT = """
v443 -> 2026-01-21 : https://github.com/inventree/InvenTree/pull/11177
- Adds IPN ordering option for BomItem API endpoint
- Adds IPN ordering option for BuildLine API endpoint
v442 -> 2026-01-17 : https://github.com/inventree/InvenTree/pull/11157 v442 -> 2026-01-17 : https://github.com/inventree/InvenTree/pull/11157
- Typo fixes, no functional changes - Typo fixes, no functional changes

View File

@@ -594,6 +594,7 @@ class BuildLineList(
output_options = BuildLineOutputOptions output_options = BuildLineOutputOptions
ordering_fields = [ ordering_fields = [
'part', 'part',
'IPN',
'allocated', 'allocated',
'category', 'category',
'consumed', 'consumed',
@@ -612,6 +613,7 @@ class BuildLineList(
ordering_field_aliases = { ordering_field_aliases = {
'part': 'bom_item__sub_part__name', 'part': 'bom_item__sub_part__name',
'IPN': 'bom_item__sub_part__IPN',
'reference': 'bom_item__reference', 'reference': 'bom_item__reference',
'unit_quantity': 'bom_item__quantity', 'unit_quantity': 'bom_item__quantity',
'category': 'bom_item__sub_part__category__name', 'category': 'bom_item__sub_part__category__name',

View File

@@ -1405,6 +1405,7 @@ class BomList(
'attrition', 'attrition',
'rounding_multiple', 'rounding_multiple',
'sub_part', 'sub_part',
'IPN',
'available_stock', 'available_stock',
'allow_variants', 'allow_variants',
'inherited', 'inherited',
@@ -1422,6 +1423,7 @@ class BomList(
ordering_field_aliases = { ordering_field_aliases = {
'category': 'sub_part__category__name', 'category': 'sub_part__category__name',
'sub_part': 'sub_part__name', 'sub_part': 'sub_part__name',
'IPN': 'sub_part__IPN',
'pricing_min': 'sub_part__pricing_data__overall_min', 'pricing_min': 'sub_part__pricing_data__overall_min',
'pricing_max': 'sub_part__pricing_data__overall_max', 'pricing_max': 'sub_part__pricing_data__overall_max',
'pricing_updated': 'sub_part__pricing_data__updated', 'pricing_updated': 'sub_part__pricing_data__updated',

View File

@@ -132,7 +132,8 @@ export function BomTable({
{ {
accessor: 'sub_part_detail.IPN', accessor: 'sub_part_detail.IPN',
title: t`IPN`, title: t`IPN`,
sortable: true sortable: true,
ordering: 'IPN'
}, },
CategoryColumn({ CategoryColumn({
accessor: 'category_detail', accessor: 'category_detail',

View File

@@ -333,7 +333,8 @@ export default function BuildLineTable({
}), }),
{ {
accessor: 'part_detail.IPN', accessor: 'part_detail.IPN',
sortable: false, sortable: true,
ordering: 'IPN',
title: t`IPN` title: t`IPN`
}, },
CategoryColumn({ CategoryColumn({