diff --git a/InvenTree/templates/js/translated/bom.js b/InvenTree/templates/js/translated/bom.js
index 798c6749ec..5b1c7e2bb2 100644
--- a/InvenTree/templates/js/translated/bom.js
+++ b/InvenTree/templates/js/translated/bom.js
@@ -50,6 +50,13 @@ function constructBomUploadTable(data, options={}) {
}
);
+ var buttons = `
`;
+
+ buttons += makeIconButton('fa-file-alt', 'button-row-data', idx, '{% trans "Display row data" %}');
+ buttons += makeIconButton('fa-times icon-red', 'button-row-remove', idx, '{% trans "Remove row" %}');
+
+ buttons += `
`;
+
var html = `
${part_input} |
@@ -60,6 +67,7 @@ function constructBomUploadTable(data, options={}) {
inherited |
optional |
note |
+ ${buttons} |
`;
$('#bom-import-table tbody').append(html);
@@ -68,6 +76,7 @@ function constructBomUploadTable(data, options={}) {
initializeRelatedField(
{
name: `part_${idx}`,
+ value: row.part,
api_url: '{% url "api-part-list" %}',
filters: {
component: true,
diff --git a/InvenTree/templates/js/translated/forms.js b/InvenTree/templates/js/translated/forms.js
index ff4415404f..c2addc3594 100644
--- a/InvenTree/templates/js/translated/forms.js
+++ b/InvenTree/templates/js/translated/forms.js
@@ -1484,10 +1484,19 @@ function initializeRelatedField(field, fields, options={}) {
// limit size for AJAX requests
var pageSize = options.pageSize || 25;
+ var parent = null;
+ var auto_width = true;
+
+ // Special considerations if the select2 input is a child of a modal
+ if (options && options.modal) {
+ parent = $(options.modal);
+ auto_width = true;
+ }
+
select.select2({
placeholder: '',
- dropdownParent: $(options.modal),
- dropdownAutoWidth: false,
+ dropdownParent: parent,
+ dropdownAutoWidth: auto_width,
language: {
noResults: function(query) {
if (field.noResults) {