From 9d8b88e86d8a9e5792e5a3ef79ac2c90eed10617 Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Thu, 25 Nov 2021 12:29:27 +0100 Subject: [PATCH] [FIX] sale_timesheet: Avoid pricelist side effect with other modules --- addons/sale_timesheet/tests/common_reporting.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/addons/sale_timesheet/tests/common_reporting.py b/addons/sale_timesheet/tests/common_reporting.py index 03814923b24..ebbdcc0dd2d 100644 --- a/addons/sale_timesheet/tests/common_reporting.py +++ b/addons/sale_timesheet/tests/common_reporting.py @@ -9,6 +9,16 @@ class TestCommonReporting(TestCommonSaleTimesheet): def setUpClass(cls, chart_template_ref=None): super().setUpClass(chart_template_ref=chart_template_ref) + # Note: According to the installed module, a default pricelist is set + # on the created company (see create override on product module) + # Force the pricelist on the company to avoid having a random one + # with advanced discount configuration, etc... + cls.env['ir.property']._set_default( + 'property_product_pricelist', 'res.partner', + cls.company_data['default_pricelist'], + cls.company_data['company'], + ) + # expense product cls.product_expense = cls.env['product.product'].with_context(mail_notrack=True, mail_create_nolog=True).create({ 'name': "Expense service",