2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-19 13:35:40 +00:00

Use collapse template in allocation page

This commit is contained in:
Oliver Walters
2019-05-02 18:53:03 +10:00
parent 18c5ad7a6e
commit fbb120da53
3 changed files with 36 additions and 36 deletions

View File

@ -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