mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-12 01:55:39 +00:00
Build allocation table updates (#7106)
* Update build line allocation table - Allow display of "tracked" items in main allocation table * Add resolveItem function for finding nested items * Update BuildLineTable * Allow BuildLineList to be ordered by 'trackable' field * Bump API version
This commit is contained in:
@ -1,11 +1,14 @@
|
||||
"""InvenTree API version information."""
|
||||
|
||||
# InvenTree API version
|
||||
INVENTREE_API_VERSION = 191
|
||||
INVENTREE_API_VERSION = 192
|
||||
"""Increment this API version number whenever there is a significant change to the API that any clients need to know about."""
|
||||
|
||||
INVENTREE_API_TEXT = """
|
||||
|
||||
v192 - 2024-04-23 : https://github.com/inventree/InvenTree/pull/7106
|
||||
- Adds 'trackable' ordering option to BuildLineLabel API endpoint
|
||||
|
||||
v191 - 2024-04-22 : https://github.com/inventree/InvenTree/pull/7079
|
||||
- Adds API endpoints for Contenttype model
|
||||
|
||||
|
@ -349,6 +349,7 @@ class BuildLineList(BuildLineEndpoint, ListCreateAPI):
|
||||
'optional',
|
||||
'unit_quantity',
|
||||
'available_stock',
|
||||
'trackable',
|
||||
]
|
||||
|
||||
ordering_field_aliases = {
|
||||
@ -357,6 +358,7 @@ class BuildLineList(BuildLineEndpoint, ListCreateAPI):
|
||||
'unit_quantity': 'bom_item__quantity',
|
||||
'consumable': 'bom_item__consumable',
|
||||
'optional': 'bom_item__optional',
|
||||
'trackable': 'bom_item__sub_part__trackable',
|
||||
}
|
||||
|
||||
search_fields = [
|
||||
|
@ -2436,11 +2436,9 @@ function loadBuildLineTable(table, build_id, options={}) {
|
||||
params.build = build_id;
|
||||
|
||||
if (output) {
|
||||
params.tracked = true;
|
||||
params.output = output;
|
||||
name += `-${output}`;
|
||||
} else {
|
||||
// Default to untracked parts for the build
|
||||
params.tracked = false;
|
||||
}
|
||||
|
||||
let filters = loadTableFilters('buildlines', params);
|
||||
@ -2649,7 +2647,11 @@ function loadBuildLineTable(table, build_id, options={}) {
|
||||
|
||||
if (row.part_detail.trackable && !options.output) {
|
||||
// Tracked parts must be allocated to a specific build output
|
||||
return `<em>{% trans "Tracked item" %}</em>`;
|
||||
return `
|
||||
<div>
|
||||
<em>{% trans "Tracked item" %}</em>
|
||||
<span title='{% trans "Allocate tracked items against individual build outputs" %}' class='fas fa-info-circle icon-blue' />
|
||||
</div>`;
|
||||
}
|
||||
|
||||
if (row.allocated < row.quantity) {
|
||||
|
Reference in New Issue
Block a user