mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-16 12:05:53 +00:00
Cleanup getRequiredParts function
This commit is contained in:
@ -1083,10 +1083,12 @@ class Part(MPTTModel):
|
||||
parts: Set of parts already found (to prevent recursion issues)
|
||||
"""
|
||||
|
||||
for bom_item in self.bom_items.all().select_related('sub_part'):
|
||||
items = self.bom_items.all().prefetch_related('sub_part')
|
||||
|
||||
for bom_item in items:
|
||||
|
||||
sub_part = bom_item.sub_part
|
||||
|
||||
|
||||
if sub_part not in parts:
|
||||
|
||||
parts.add(sub_part)
|
||||
|
Reference in New Issue
Block a user