2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-06 05:30:56 +00:00

Expose some more stock item data over API

This commit is contained in:
Oliver Walters
2020-05-22 23:33:27 +10:00
parent 203062a67a
commit 4bd0872b2c
4 changed files with 17 additions and 15 deletions

View File

@ -1007,6 +1007,10 @@ class StockItem(MPTTModel):
'failed': failed,
}
@property
def required_test_count(self):
return self.part.getRequiredTests().count()
def hasRequiredTests(self):
return self.part.getRequiredTests().count() > 0