2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 04:55:44 +00:00

Build API improvements (#3581)

* Improve build order lookup

* Query efficiency improvements

* Lazy load build allocation table

* API defaults ensure consistent behaviour
This commit is contained in:
Oliver
2022-08-19 17:16:38 +10:00
committed by GitHub
parent 89d5df4f1e
commit b886e54709
5 changed files with 24 additions and 11 deletions

View File

@ -731,6 +731,7 @@ function loadBuildOrderAllocationTable(table, options={}) {
options.params['part_detail'] = true;
options.params['build_detail'] = true;
options.params['location_detail'] = true;
options.params['stock_detail'] = true;
var filters = loadTableFilters('buildorderallocation');
@ -1718,9 +1719,10 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) {
field: 'location',
title: '{% trans "Location" %}',
formatter: function(value, row) {
if (row.stock_item_detail.location) {
var text = row.stock_item_detail.location_name;
var url = `/stock/location/${row.stock_item_detail.location}/`;
if (row.location && row.location_detail) {
var text = row.location_detail.name;
var url = `/stock/location/${row.location}/`;
return renderLink(text, url);
} else {