From 5a73fbbcaceea2059b8396f6d33e24a8c749e23c Mon Sep 17 00:00:00 2001 From: "Andrea Grazioso (agr-odoo)" Date: Fri, 13 Dec 2019 14:00:42 +0000 Subject: [PATCH] [FIX] point_of_sale: remove tax info from test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This test will use a tax account and will possibly fail in case the information is not loaded when test is executed closes odoo/odoo#41884 X-original-commit: 9663bfe506fecf46200378e5934f9ba32b4497c1 Signed-off-by: Xavier Dollé (xdo) --- .../tests/test_point_of_sale_flow.py | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/addons/point_of_sale/tests/test_point_of_sale_flow.py b/addons/point_of_sale/tests/test_point_of_sale_flow.py index 6d9a96eed9b..aa0ba016b4e 100644 --- a/addons/point_of_sale/tests/test_point_of_sale_flow.py +++ b/addons/point_of_sale/tests/test_point_of_sale_flow.py @@ -142,23 +142,28 @@ class TestPointOfSaleFlow(TestPointOfSaleCommon): 'price_unit': 6, 'discount': 0, 'qty': 2, - 'tax_ids': [[6, False, [1]]], + 'tax_ids': [[6, False, []]], 'price_subtotal': 12, - 'price_subtotal_incl': 13.8, + 'price_subtotal_incl': 12, 'pack_lot_ids': [ [0, 0, {'lot_name': '1001'}], [0, 0, {'lot_name': '1002'}], ] })], 'pricelist_id': 1, - 'amount_paid': 13.8, - 'amount_total': 13.8, - 'amount_tax': 1.8, - 'amount_return': 6.2, + 'amount_paid': 12.0, + 'amount_total': 12.0, + 'amount_tax': 0.0, + 'amount_return': 0.0, 'to_invoice': False, }) - order.action_pos_order_paid() + payment_context = {"active_ids": order.ids, "active_id": order.id} + order_payment = self.PosMakePayment.with_context(**payment_context).create({ + 'amount': order.amount_total, + 'payment_method_id': self.cash_payment_method.id + }) + order_payment.with_context(**payment_context).check() # I create a refund refund_action = order.refund() @@ -181,6 +186,7 @@ class TestPointOfSaleFlow(TestPointOfSaleCommon): refund_payment.with_context(**payment_context).check() self.assertEqual(refund.state, 'paid', "The refund is not marked as paid") + current_session.action_pos_session_closing_control() def test_order_to_picking(self): """