mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-03 04:00:57 +00:00
Display table of StockItems which have been split from the current item
- The StockItem list api now allows filtering by 'ancestor' - Add 'children' tab for StockItem - Needed to tweak the unit testing fixtures (yay thanks MPTT)
This commit is contained in:
@ -385,12 +385,17 @@ class StockItem(MPTTModel):
|
||||
|
||||
return True
|
||||
|
||||
@property
|
||||
def children(self):
|
||||
""" Return a list of the child items which have been split from this stock item """
|
||||
return self.get_descendants(include_self=False)
|
||||
|
||||
@property
|
||||
def child_count(self):
|
||||
""" Return the number of 'child' items associated with this StockItem.
|
||||
A child item is one which has been split from this one.
|
||||
"""
|
||||
return self.get_descendants(include_self=False).count()
|
||||
return self.children.count()
|
||||
|
||||
@property
|
||||
def in_stock(self):
|
||||
|
Reference in New Issue
Block a user