2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-06-12 03:28:37 +00:00

Count to location (#12019)

* Add "location" field to StockCountSerializer

* Adjust location on stock count

* Add unit tests

* Add docs

* Update API and CHANGELOG
This commit is contained in:
Oliver
2026-05-27 23:41:40 +10:00
committed by GitHub
parent 33483a3824
commit a9549c2e07
7 changed files with 125 additions and 1 deletions
+9
View File
@@ -967,6 +967,9 @@ function stockCountFields(items: any[]): ApiFormFieldSet {
const initialValue = mapAdjustmentItems(items);
// Extract all location values from the items
const locations = [...new Set(items.map((item) => item.location))];
const fields: ApiFormFieldSet = {
items: {
field_type: 'table',
@@ -990,6 +993,12 @@ function stockCountFields(items: any[]): ApiFormFieldSet {
{ title: t`Actions` }
]
},
location: {
value: locations.length === 1 ? locations[0] : undefined,
filters: {
structural: false
}
},
notes: {}
};