diff --git a/InvenTree/templates/js/translated/forms.js b/InvenTree/templates/js/translated/forms.js index 0e815f8c6d..f1f8f632e5 100644 --- a/InvenTree/templates/js/translated/forms.js +++ b/InvenTree/templates/js/translated/forms.js @@ -1168,7 +1168,7 @@ function addSecondaryModal(field, fields, options) { /* - * Initializea single related-field + * Initialize a single related-field * * argument: * - modal: DOM identifier for the modal window diff --git a/InvenTree/templates/js/translated/helpers.js b/InvenTree/templates/js/translated/helpers.js index 6e3f7f0c95..164452952d 100644 --- a/InvenTree/templates/js/translated/helpers.js +++ b/InvenTree/templates/js/translated/helpers.js @@ -65,7 +65,7 @@ function imageHoverIcon(url) { function thumbnailImage(url) { if (!url) { - url = '/static/img/blank_img.png'; + url = blankImage(); } // TODO: Support insertion of custom classes diff --git a/InvenTree/templates/js/translated/model_renderers.js b/InvenTree/templates/js/translated/model_renderers.js index 389d5a650f..eeb3cdbad2 100644 --- a/InvenTree/templates/js/translated/model_renderers.js +++ b/InvenTree/templates/js/translated/model_renderers.js @@ -49,9 +49,18 @@ function renderStockItem(name, data, parameters, options) { var image = data.part_detail.thumbnail || data.part_detail.image || blankImage(); - var html = ``; + var html = ''; + + var render_part_detail = true; - html += ` ${data.part_detail.full_name || data.part_detail.name}`; + if ("render_part_detail" in parameters) { + render_part_detail = parameters["render_part_detail"]; + } + + if (render_part_detail) { + html += ``; + html += ` ${data.part_detail.full_name || data.part_detail.name}`; + } if (data.serial && data.quantity == 1) { html += ` - {% trans "Serial Number" %}: ${data.serial}`; @@ -59,10 +68,20 @@ function renderStockItem(name, data, parameters, options) { html += ` - {% trans "Quantity" %}: ${data.quantity}`; } - if (data.part_detail.description) { + if (render_part_detail && data.part_detail.description) { html += `

${data.part_detail.description}

`; } + var render_location_detail = false; + + if ("render_location_detail" in parameters) { + render_location_detail = parameters["render_location_detail"]; + } + + if (render_location_detail && data.location_detail) { + html += `

${data.location_detail.pathstring}

`; + } + return html; }