mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 12:06:44 +00:00
Bug fix for test cases
This commit is contained in:
parent
9da8189899
commit
dbdbe69f7f
@ -616,6 +616,8 @@ class StockItem(models.Model):
|
|||||||
if quantity < 0:
|
if quantity < 0:
|
||||||
quantity = 0
|
quantity = 0
|
||||||
|
|
||||||
|
self.quantity = quantity
|
||||||
|
|
||||||
if quantity == 0 and self.delete_on_deplete and self.can_delete():
|
if quantity == 0 and self.delete_on_deplete and self.can_delete():
|
||||||
|
|
||||||
# TODO - Do not actually "delete" stock at this point - instead give it a "DELETED" flag
|
# TODO - Do not actually "delete" stock at this point - instead give it a "DELETED" flag
|
||||||
|
@ -245,7 +245,7 @@ class StockTest(TestCase):
|
|||||||
w1 = StockItem.objects.get(pk=100)
|
w1 = StockItem.objects.get(pk=100)
|
||||||
w2 = StockItem.objects.get(pk=101)
|
w2 = StockItem.objects.get(pk=101)
|
||||||
|
|
||||||
# Take 25 units from w1
|
# Take 25 units from w1 (there are only 10 in stock)
|
||||||
w1.take_stock(30, None, notes='Took 30')
|
w1.take_stock(30, None, notes='Took 30')
|
||||||
|
|
||||||
# Get from database again
|
# Get from database again
|
||||||
|
Loading…
x
Reference in New Issue
Block a user