mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 11:36:44 +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:
parent
a78b26f93a
commit
752fb97d2f
@ -459,7 +459,8 @@ def rebuild_parameters(template_id):
|
|||||||
parameter.save()
|
parameter.save()
|
||||||
n += 1
|
n += 1
|
||||||
|
|
||||||
logger.info(f"Rebuilt {n} parameters for template '{template.name}'")
|
if n > 0:
|
||||||
|
logger.info(f"Rebuilt {n} parameters for template '{template.name}'")
|
||||||
|
|
||||||
|
|
||||||
def rebuild_supplier_parts(part_id):
|
def rebuild_supplier_parts(part_id):
|
||||||
@ -486,4 +487,5 @@ def rebuild_supplier_parts(part_id):
|
|||||||
except ValidationError:
|
except ValidationError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
logger.info(f"Rebuilt {n} supplier parts for part '{prt.name}'")
|
if n > 0:
|
||||||
|
logger.info(f"Rebuilt {n} supplier parts for part '{prt.name}'")
|
||||||
|
@ -1148,7 +1148,26 @@ function adjustStock(action, items, options={}) {
|
|||||||
var extraFields = {};
|
var extraFields = {};
|
||||||
|
|
||||||
if (specifyLocation) {
|
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 = {
|
extraFields.location = {
|
||||||
|
value: commonLocation,
|
||||||
filters: {
|
filters: {
|
||||||
structural: false,
|
structural: false,
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user