feat(stock): add exclude_from_stock option to StockLocation (#7064) (#13166)

* feat(stock): add exclude_from_stock option to StockLocation (#7064)

* feat(stock): add UI detail, table filters, API version bump, and prek formatting (#7064)

---------

Co-authored-by: UGREEN USER <jaharoni@debian.dedomain>
Co-authored-by: WholeTroutMedia <cortex@inceptionengine.systems>
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
authored and GitHub committed 2026-11-05 12:06:26 +11:00
1 parent d5d0bfabc4
commit d01645c5fb
12 files changed
+105 -3

No files matched your search

+1
View File
@@ -2195,6 +2195,7 @@ export function useStockLocationFields(): ApiFormFieldSet {
},
structural: {},
external: {},
exclude_from_stock: {},
custom_icon: {
field_type: 'icon'
},
@@ -78,6 +78,11 @@ export function StockLocationDetailsPanel({
name: 'external',
label: t`External`
},
{
type: 'boolean',
name: 'exclude_from_stock',
label: t`Exclude from Stock`
},
{
type: 'string',
name: 'location_type_detail.name',
@@ -320,6 +320,11 @@ function stockItemTableFilters({
label: t`External Location`,
description: t`Show items in an external location`
},
{
name: 'exclude_from_stock',
label: t`Exclude from Stock`,
description: t`Show items in a location excluded from stock calculations`
},
TagsFilter({ modelType: ModelType.stockitem })
];
}
@@ -51,6 +51,11 @@ export function StockLocationTable({ parentId }: Readonly<{ parentId?: any }>) {
label: t`External`,
description: t`Show external locations`
},
{
name: 'exclude_from_stock',
label: t`Exclude from Stock`,
description: t`Show locations excluded from stock calculations`
},
{
name: 'has_location_type',
label: t`Has location type`
@@ -97,6 +102,10 @@ export function StockLocationTable({ parentId }: Readonly<{ parentId?: any }>) {
accessor: 'external',
defaultVisible: false
}),
BooleanColumn({
accessor: 'exclude_from_stock',
defaultVisible: false
}),
{
accessor: 'location_type',
sortable: false,