mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #1625 from SchrodingersGat/parent-node-fixes
Specify a unique parent node that cannot shadow an existing pk
This commit is contained in:
commit
96624d1175
@ -81,15 +81,17 @@ function loadStockTestResultsTable(table, options) {
|
||||
return html;
|
||||
}
|
||||
|
||||
var parent_node = "parent node";
|
||||
|
||||
table.inventreeTable({
|
||||
url: "{% url 'api-part-test-template-list' %}",
|
||||
method: 'get',
|
||||
name: 'testresult',
|
||||
treeEnable: true,
|
||||
rootParentId: options.stock_item,
|
||||
rootParentId: parent_node,
|
||||
parentIdField: 'parent',
|
||||
idField: 'pk',
|
||||
uniqueId: 'pk',
|
||||
uniqueId: 'key',
|
||||
treeShowField: 'test_name',
|
||||
formatNoMatches: function() {
|
||||
return '{% trans "No test results found" %}';
|
||||
@ -190,7 +192,7 @@ function loadStockTestResultsTable(table, options) {
|
||||
match = true;
|
||||
|
||||
if (row.result == null) {
|
||||
item.parent = options.stock_item;
|
||||
item.parent = parent_node;
|
||||
tableData[index] = item;
|
||||
override = true;
|
||||
} else {
|
||||
@ -202,7 +204,7 @@ function loadStockTestResultsTable(table, options) {
|
||||
// No match could be found
|
||||
if (!match) {
|
||||
item.test_name = item.test;
|
||||
item.parent = options.stock_item;
|
||||
item.parent = parent_node;
|
||||
}
|
||||
|
||||
if (!override) {
|
||||
|
Loading…
Reference in New Issue
Block a user