From 40cc20121bac450f8f83e9291ebfbbaeec3879b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 3 Apr 2023 01:17:03 +0200 Subject: [PATCH] Test on forecast record name fails after 31 March 2023 The test was added with 3b15c1378292 but as there is a computed active field on forecast based on the "to date", the search by record name does not find any active record. --- modules/stock_forecast/tests/test_module.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/stock_forecast/tests/test_module.py b/modules/stock_forecast/tests/test_module.py index 984d3e8c2b..8b667424c4 100644 --- a/modules/stock_forecast/tests/test_module.py +++ b/modules/stock_forecast/tests/test_module.py @@ -10,7 +10,7 @@ from trytond.modules.company.tests import ( CompanyTestMixin, create_company, set_company) from trytond.pool import Pool from trytond.tests.test_tryton import ModuleTestCase, with_transaction -from trytond.transaction import Transaction +from trytond.transaction import Transaction, inactive_records class StockForecastTestCase(CompanyTestMixin, ModuleTestCase): @@ -35,7 +35,8 @@ class StockForecastTestCase(CompanyTestMixin, ModuleTestCase): to_date=datetime.date(2023, 3, 31), ) forecast.save() - forecasts = Forecast.search([('rec_name', '=', "Warehouse")]) + with inactive_records(): + forecasts = Forecast.search([('rec_name', '=', "Warehouse")]) self.assertEqual( forecast.rec_name,