Bug fix for BuildOrder.bom_items

- Now uses the query generator provided by the Part model
- No more code duplication
- More importantly, no more code duplication which is WRONG!
This commit is contained in:
Oliver committed 2022-03-01 23:53:33 +11:00
1 parent a30e478412
commit 28a7ad7f0e
2 files changed
+4 -4

No files matched your search

+1 -3
View File
@@ -383,9 +383,7 @@ class Build(MPTTModel, ReferenceIndexingMixin):
Returns the BOM items for the part referenced by this BuildOrder
"""
return self.part.bom_items.all().prefetch_related(
'sub_part'
)
return self.part.get_bom_items()
@property
def tracked_bom_items(self):