2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

Furher logic improvements to BOM copy

- Remove "self" part from list
- Stop inherited BOM items from being copied incorrectly
- Allow user to select whether "inherited" BOM items are copied
This commit is contained in:
Oliver
2021-12-21 22:07:08 +11:00
parent 0c8a047bc2
commit 70f9a0fe13
5 changed files with 95 additions and 43 deletions

View File

@ -661,7 +661,7 @@ function loadBomTable(table, options={}) {
if (!row.inherited) {
return yesNoLabel(false);
} else if (row.part == options.parent_id) {
return '{% trans "Inherited" %}';
return yesNoLabel(true);
} else {
// If this BOM item is inherited from a parent part
return renderLink(

View File

@ -438,15 +438,20 @@ function duplicateBom(part_id, options={}) {
icon: 'fa-shapes',
filters: {
assembly: true,
ancestor: part_id,
exclude_tree: part_id,
}
},
remove_existing: {
value: true,
},
include_inherited: {},
remove_existing: {},
skip_invalid: {},
},
confirm: true,
title: '{% trans "Copy Bill of Materials" %}',
onSuccess: function(response) {
if (options.success) {
options.success(response);
}
},
});
}