mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-18 13:05:42 +00:00
Transfer stock location (#5117)
* Hide info messages if no data * pre-fill location when transferring stock * Change iteration variable * Measure twice, cut once * js improvements
This commit is contained in:
@ -1148,7 +1148,26 @@ function adjustStock(action, items, options={}) {
|
||||
var extraFields = {};
|
||||
|
||||
if (specifyLocation) {
|
||||
|
||||
// If a common location is specified, use that as the default
|
||||
let commonLocation = null;
|
||||
|
||||
for (const item of items) {
|
||||
|
||||
if (item.location == commonLocation) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (commonLocation == null) {
|
||||
commonLocation = item.location;
|
||||
} else {
|
||||
commonLocation = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
extraFields.location = {
|
||||
value: commonLocation,
|
||||
filters: {
|
||||
structural: false,
|
||||
},
|
||||
|
Reference in New Issue
Block a user