2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-11 07:24:15 +00:00

Allow adjustment for destroyed (or lost) stock

This commit is contained in:
Oliver Walters
2021-02-19 15:13:56 +11:00
parent ca16e4f35d
commit ea4b713eed
2 changed files with 22 additions and 1 deletions

View File

@ -832,6 +832,27 @@ class StockItem(MPTTModel):
return query.exists()
@property
def can_adjust_location(self):
"""
Returns True if the stock location can be "adjusted" for this part
Cannot be adjusted if:
- Has been delivered to a customer
- Has been installed inside another StockItem
"""
if self.customer is not None:
return False
if self.belongs_to is not None:
return False
if self.sales_order is not None:
return False
return True
@property
def tracking_info_count(self):
return self.tracking_info.count()