From 56c3b0882e147919b032f459b558bbf029713fc2 Mon Sep 17 00:00:00 2001 From: david Date: Wed, 26 Aug 2020 10:27:24 +0200 Subject: [PATCH] [FIX] pos_order_mgmt: don't relay on demo data Ensure test correctness when a different default localization is set on the CI --- pos_order_mgmt/tests/test_module.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/pos_order_mgmt/tests/test_module.py b/pos_order_mgmt/tests/test_module.py index 1478a90a..686639b2 100644 --- a/pos_order_mgmt/tests/test_module.py +++ b/pos_order_mgmt/tests/test_module.py @@ -16,9 +16,22 @@ class TestModule(TransactionCase): self.AccountPayment = self.env['account.payment'] # Get Object - self.pos_product = self.env.ref('point_of_sale.whiteboard_pen') - self.pricelist = self.env.ref('product.list0') - self.partner = self.env.ref('base.res_partner_12') + self.pos_product = self.env["product.product"].create({ + "name": "Test POS Product", + }) + self.pricelist = self.env["product.pricelist"].create({ + "name": "Test pricelist", + "currency_id": self.env.user.company_id.currency_id.id, + "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, + }) # Create a new pos config and open it self.pos_config = self.env.ref('point_of_sale.pos_config_main').copy()