2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 20:45:44 +00:00

Fix on_order calculation

- Take into account the number "received"
- Also fix unit tests
This commit is contained in:
Oliver Walters
2020-03-26 17:56:44 +11:00
parent 6a78f6d451
commit 713d7960a8
2 changed files with 11 additions and 4 deletions

View File

@ -130,9 +130,10 @@ class OrderTest(TestCase):
order.receive_line_item(line, loc, 50, user=None)
line = PurchaseOrderLineItem.objects.get(id=2)
order.receive_line_item(line, loc, 2 * line.quantity, user=None)
self.assertEqual(part.on_order, 1100)
order.receive_line_item(line, loc, 500, user=None)
self.assertEqual(part.on_order, 800)
self.assertEqual(order.status, OrderStatus.PLACED)
for line in order.pending_line_items():