2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

Implement structural stock locations (#3949)

* Implement structural stock locations

* Bumped API version
This commit is contained in:
Miklós Márton
2022-11-19 12:24:18 +01:00
committed by GitHub
parent bc8a6ae4b8
commit 0716238f3b
10 changed files with 167 additions and 7 deletions

View File

@ -60,9 +60,15 @@ function buildFormFields() {
},
take_from: {
icon: 'fa-sitemap',
filters: {
structural: false,
}
},
destination: {
icon: 'fa-sitemap',
filters: {
structural: false,
}
},
link: {
icon: 'fa-link',
@ -524,7 +530,11 @@ function completeBuildOutputs(build_id, outputs, options={}) {
preFormContent: html,
fields: {
status: {},
location: {},
location: {
filters: {
structural: false,
},
},
notes: {},
accept_incomplete_allocation: {},
},
@ -2391,7 +2401,7 @@ function autoAllocateStockToBuild(build_id, bom_items=[], options={}) {
<strong>{% trans "Automatic Stock Allocation" %}</strong><br>
{% trans "Stock items will be automatically allocated to this build order, according to the provided guidelines" %}:
<ul>
<li>{% trans "If a location is specifed, stock will only be allocated from that location" %}</li>
<li>{% trans "If a location is specified, stock will only be allocated from that location" %}</li>
<li>{% trans "If stock is considered interchangeable, it will be allocated from the first location it is found" %}</li>
<li>{% trans "If substitute stock is allowed, it will be used where stock of the primary part cannot be found" %}</li>
</ul>
@ -2401,6 +2411,9 @@ function autoAllocateStockToBuild(build_id, bom_items=[], options={}) {
var fields = {
location: {
value: options.location,
filters: {
structural: false,
}
},
exclude_location: {},
interchangeable: {

View File

@ -888,7 +888,11 @@ function poLineItemFields(options={}) {
purchase_price: {},
purchase_price_currency: {},
target_date: {},
destination: {},
destination: {
filters: {
structural: false,
}
},
notes: {},
};
@ -1688,7 +1692,11 @@ function receivePurchaseOrderItems(order_id, line_items, options={}) {
constructForm(`/api/order/po/${order_id}/receive/`, {
method: 'POST',
fields: {
location: {},
location: {
filters: {
structural: false,
}
},
},
preFormContent: html,
confirm: true,

View File

@ -99,6 +99,9 @@ function partFields(options={}) {
icon: 'fa-link',
},
default_location: {
filters: {
structural: false,
}
},
default_supplier: {
filters: {
@ -297,7 +300,11 @@ function categoryFields() {
},
name: {},
description: {},
default_location: {},
default_location: {
filters: {
structural: false,
}
},
default_keywords: {
icon: 'fa-key',
},

View File

@ -80,6 +80,9 @@ function serializeStockItem(pk, options={}) {
},
destination: {
icon: 'fa-sitemap',
filters: {
structural: false,
}
},
notes: {},
};
@ -114,6 +117,7 @@ function stockLocationFields(options={}) {
name: {},
description: {},
owner: {},
structural: {},
icon: {
help_text: `{% trans "Icon (optional) - Explore all available icons on" %} <a href="https://fontawesome.com/v5/search?s=solid" target="_blank" rel="noopener noreferrer">Font Awesome</a>.`,
placeholder: 'fas fa-box',
@ -280,6 +284,9 @@ function stockItemFields(options={}) {
},
location: {
icon: 'fa-sitemap',
filters: {
structural: false,
},
},
quantity: {
help_text: '{% trans "Enter initial quantity for this stock item" %}',
@ -838,6 +845,9 @@ function mergeStockItems(items, options={}) {
location: {
value: location,
icon: 'fa-sitemap',
filters: {
structural: false,
}
},
notes: {},
allow_mismatched_suppliers: {},
@ -1106,7 +1116,11 @@ function adjustStock(action, items, options={}) {
var extraFields = {};
if (specifyLocation) {
extraFields.location = {};
extraFields.location = {
filters: {
structural: false,
},
};
}
if (action != 'delete') {
@ -2810,6 +2824,9 @@ function uninstallStockItem(installed_item_id, options={}) {
fields: {
location: {
icon: 'fa-sitemap',
filters: {
structural: false,
}
},
note: {},
},