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:
@@ -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: {}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user