From c1d22b6c3c605d894130251c4417b684d7cf1b54 Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Tue, 1 Aug 2017 15:52:36 +0200 Subject: [PATCH] [FIX] sale_stock: Adapt test due to c854de4 The tested use case is the following: - Create a SO with 5 units of a product (invoiced on delivered quantity) - Ship 5 units - Create an invoice with 5 units, validate - Return 2 units from delivery The current state: - Ordered : 5 - Delivered : 3 - Invoiced : 5 In that case you have invoiced more than the delivered quantity and the sales order should be marked as fully invoiced following the commit c854de4 The salesman will transfer the credit note to the accountant and everybody's happy. As it is the intended behavior, this commit modifies the test. --- addons/sale_stock/tests/test_sale_stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_stock/tests/test_sale_stock.py b/addons/sale_stock/tests/test_sale_stock.py index 5a4755d2c16..ebdf62b8493 100644 --- a/addons/sale_stock/tests/test_sale_stock.py +++ b/addons/sale_stock/tests/test_sale_stock.py @@ -172,7 +172,7 @@ class TestSaleStock(TestSale): return_pick.do_new_transfer() # Check invoice - self.assertEqual(self.so.invoice_status, 'to invoice', 'Sale Stock: so invoice_status should be "to invoice" instead of "%s" after picking return' % self.so.invoice_status) + self.assertEqual(self.so.invoice_status, 'invoiced', 'Sale Stock: so invoice_status should be "to invoice" instead of "%s" after picking return' % self.so.invoice_status) self.assertEqual(self.so.order_line[0].qty_delivered, 3.0, 'Sale Stock: delivered quantity should be 3.0 instead of "%s" after picking return' % self.so.order_line[0].qty_delivered) # let's do an invoice with refunds adv_wiz = self.env['sale.advance.payment.inv'].with_context(active_ids=[self.so.id]).create({