mirror of
https://github.com/inventree/InvenTree.git
synced 2026-10-05 18:01:14 +00:00
Add API endpoint and serializer for BuildItem model
This commit is contained in:
1 parent
17d9d25fb9
commit
c29827e45a
5 files changed
+49
-7
No files matched your search
@@ -307,6 +307,12 @@ class Part(models.Model):
|
||||
def used_in_count(self):
|
||||
return self.used_in.count()
|
||||
|
||||
def required_parts(self):
|
||||
parts = []
|
||||
for bom in self.bom_items.all():
|
||||
parts.append(bom.sub_part)
|
||||
return parts
|
||||
|
||||
@property
|
||||
def supplier_count(self):
|
||||
# Return the number of supplier parts available for this part
|
||||
|
||||
Reference in new issue
Block a user