From e43a67368384847e340c0c167cc08017b62f2b87 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 2 Apr 2019 18:08:46 +0200 Subject: [PATCH] [FIX] pos_order_return: ensure test correctness - In a CI test environment, we could end with pricelists with different currencies. This commit ensures it. --- pos_order_return/tests/test_pos_order_return.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pos_order_return/tests/test_pos_order_return.py b/pos_order_return/tests/test_pos_order_return.py index a2a657a7..17340f6c 100644 --- a/pos_order_return/tests/test_pos_order_return.py +++ b/pos_order_return/tests/test_pos_order_return.py @@ -10,8 +10,17 @@ from odoo.tests import common class TestPOSOrderReturn(common.HttpCase): def setUp(self): super(TestPOSOrderReturn, self).setUp() + self.pricelist = self.env['product.pricelist'].create({ + 'name': 'Test pricelist', + 'item_ids': [(0, 0, { + 'applied_on': '3_global', + 'compute_price': 'formula', + 'base': 'list_price', + })] + }) self.partner = self.env['res.partner'].create({ 'name': 'Mr. Odoo', + 'property_product_pricelist': self.pricelist.id, }) self.product_1 = self.env['product.product'].create({ 'name': 'Test product 1', @@ -29,6 +38,10 @@ class TestPOSOrderReturn(common.HttpCase): }) self.PosOrder = self.env['pos.order'] self.pos_config = self.env.ref('point_of_sale.pos_config_main') + self.pos_config.write({ + 'available_pricelist_ids': [(6, 0, self.pricelist.ids)], + 'pricelist_id': self.pricelist.id, + }) self.pos_config.open_session_cb() self.pos_order = self.PosOrder.create({ 'session_id': self.pos_config.current_session_id.id,