From 45fb9641b18ccc7b2addecfb757b0e21750ef13a Mon Sep 17 00:00:00 2001 From: "Xavier BOL (xbo)" Date: Wed, 12 May 2021 09:29:01 +0000 Subject: [PATCH] [FIX] sale_timesheet: not use demo data in unit test Before this commit, we use the 'product.product_category_3' external_xmlid to find the 'Services' category but this record is in fact a demo data. This commit removes this using to create a new category called 'Services' for the product created in this test. Related PR: #65146 closes odoo/odoo#70869 X-original-commit: dd68808fd074ba776f4a9f6b3218df99b887ae9b Signed-off-by: LTU-Odoo --- addons/sale_timesheet/tests/test_sale_timesheet_ui.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/sale_timesheet/tests/test_sale_timesheet_ui.py b/addons/sale_timesheet/tests/test_sale_timesheet_ui.py index 76a1a45dab0..bb1cccb966f 100644 --- a/addons/sale_timesheet/tests/test_sale_timesheet_ui.py +++ b/addons/sale_timesheet/tests/test_sale_timesheet_ui.py @@ -11,10 +11,15 @@ class TestUi(HttpCase): def setUpClass(cls): super().setUpClass() + service_category_id = cls.env['product.category'].create({ + 'name': 'Services', + 'parent_id': cls.env.ref('product.product_category_1').id, + }).id + uom_hour_id = cls.env.ref('uom.product_uom_hour').id cls.prepaid_service_product = cls.env['product.product'].create({ 'name': 'Service Product (Prepaid Hours)', - 'categ_id': cls.env.ref('product.product_category_3').id, + 'categ_id': service_category_id, 'type': 'service', 'list_price': 250.00, 'standard_price': 190.00,