2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-11 07:24:15 +00:00

Small tweaks for BOM export

- Steps towards preventing circular BOMs
- Improve formatting of exported BOM
This commit is contained in:
Oliver Walters
2020-02-12 10:18:20 +11:00
parent d04fb0d826
commit 28e9d842bf
2 changed files with 16 additions and 3 deletions

View File

@ -131,11 +131,13 @@ class BomItemResource(ModelResource):
level = Field(attribute='level', readonly=True)
part = Field(attribute='part', widget=widgets.ForeignKeyWidget(Part))
bom_id = Field(attribute='pk')
parent_part_id = Field(attribute='part', widget=widgets.ForeignKeyWidget(Part))
parent_part_name = Field(attribute='part__full_name', readonly=True)
id = Field(attribute='sub_part', widget=widgets.ForeignKeyWidget(Part))
sub_part_id = Field(attribute='sub_part', widget=widgets.ForeignKeyWidget(Part))
sub_part_name = Field(attribute='sub_part__full_name', readonly=True)
@ -147,7 +149,12 @@ class BomItemResource(ModelResource):
report_skipped = False
clean_model_instances = True
exclude = ['checksum', ]
exclude = [
'checksum',
'id',
'part',
'sub_part',
]
class BomItemAdmin(ImportExportModelAdmin):