diff --git a/src/backend/InvenTree/part/admin.py b/src/backend/InvenTree/part/admin.py index 7ca74d75bc..89a23cefcc 100644 --- a/src/backend/InvenTree/part/admin.py +++ b/src/backend/InvenTree/part/admin.py @@ -401,6 +401,9 @@ class BomItemResource(InvenTreeResource): part_ipn = Field( attribute='sub_part__IPN', column_name=_('Part IPN'), readonly=True ) + part_revision = Field( + attribute='sub_part__revision', column_name=_('Part Revision'), readonly=True + ) part_name = Field( attribute='sub_part__name', column_name=_('Part Name'), readonly=True ) diff --git a/src/backend/InvenTree/part/bom.py b/src/backend/InvenTree/part/bom.py index 88b67d17e0..d692b66ad9 100644 --- a/src/backend/InvenTree/part/bom.py +++ b/src/backend/InvenTree/part/bom.py @@ -117,6 +117,14 @@ def ExportBom( for bom_item in bom_items: substitutes = BomItemSubstitute.objects.filter(bom_item=bom_item) for s_idx, substitute in enumerate(substitutes): + """Create substitute part IPN column""" + name = f'{_("Substitute IPN")}{s_idx + 1}' + value = substitute.part.IPN + try: + substitute_cols[name].update({col_index: value}) + except KeyError: + substitute_cols[name] = {col_index: value} + """Create substitute part name column""" name = f'{_("Substitute Part")}{s_idx + 1}' value = substitute.part.name diff --git a/src/backend/InvenTree/part/test_bom_export.py b/src/backend/InvenTree/part/test_bom_export.py index 6913c43944..7702e94210 100644 --- a/src/backend/InvenTree/part/test_bom_export.py +++ b/src/backend/InvenTree/part/test_bom_export.py @@ -111,6 +111,7 @@ class BomExportTest(InvenTreeTestCase): 'Parent Name', 'Part ID', 'Part IPN', + 'Part Revision', 'Part Name', 'Description', 'Assembly',