Rendering fix for build allocation table (#5145) (#5149)

- Fix link to part
- Fix link to stock item

(cherry picked from commit 5f61b5f120)

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
github-actions[bot] 2023-07-04 13:40:40 +10:00 committed by GitHub
parent 01aaf95a0e
commit 2660889879
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2255,16 +2255,16 @@ function renderBuildLineAllocationTable(element, build_line, options={}) {
{
field: 'part',
title: '{% trans "Part" %}',
formatter: function(value, row) {
formatter: function(_value, row) {
let html = imageHoverIcon(row.part_detail.thumbnail);
html += renderLink(row.part_detail.full_name, `/part/${value}/`);
html += renderLink(row.part_detail.full_name, `/part/${row.part_detail.pk}/`);
return html;
}
},
{
field: 'quantity',
title: '{% trans "Allocated Quantity" %}',
formatter: function(value, row) {
formatter: function(_value, row) {
let text = '';
let url = '';
let serial = row.serial;
@ -2294,8 +2294,8 @@ function renderBuildLineAllocationTable(element, build_line, options={}) {
title: '{% trans "Location" %}',
formatter: function(value, row) {
if (row.location_detail) {
var text = shortenString(row.location_detail.pathstring);
var url = `/stock/location/${row.location}/`;
let text = shortenString(row.location_detail.pathstring);
let url = `/stock/location/${row.location_detail.pk}/`;
return renderLink(text, url);
} else {