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

Mark a SalesOrder as "shipped"

- Option to hide non-stock items from stock list
- Update models with new feature
This commit is contained in:
Oliver Walters
2020-04-25 08:46:28 +10:00
parent c5b93e2392
commit b351976ae9
8 changed files with 73 additions and 12 deletions

View File

@ -634,6 +634,8 @@ class StockItem(MPTTModel):
# Remove the specified quantity from THIS stock item
self.take_stock(quantity, user, 'Split {n} items into new stock item'.format(n=quantity))
# Return a copy of the "new" stock item
@transaction.atomic
def move(self, location, notes, user, **kwargs):
""" Move part to a new location.
@ -656,6 +658,9 @@ class StockItem(MPTTModel):
except InvalidOperation:
return False
if not self.in_stock:
raise ValidationError(_("StockItem cannot be moved as it is not in stock"))
if quantity <= 0:
return False