2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 03:00:54 +00:00

Fixes for "auto allocate" concept

This commit is contained in:
Oliver Walters
2020-10-29 00:49:01 +11:00
parent 551064b3a4
commit a263d2fdcd
6 changed files with 104 additions and 23 deletions

View File

@ -726,6 +726,15 @@ class StockItem(MPTTModel):
@property
def in_stock(self):
"""
Returns True if this item is in stock
See also: IN_STOCK_FILTER
"""
# Quantity must be above zero (unless infinite)
if self.quantity <= 0 and not self.infinite:
return False
# Not 'in stock' if it has been installed inside another StockItem
if self.belongs_to is not None: