mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-03 04:00:57 +00:00
Add custom migration
- Required to initialize the MPTT fields for the StockItem model
This commit is contained in:
@ -385,6 +385,13 @@ class StockItem(MPTTModel):
|
||||
|
||||
return True
|
||||
|
||||
@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()
|
||||
|
||||
@property
|
||||
def in_stock(self):
|
||||
|
||||
|
Reference in New Issue
Block a user