From b920d6fff4085d1e4aed928b010b5ce9354d5dca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 3 Feb 2022 22:29:08 +0100 Subject: [PATCH] Use select to True on create_date If the index is created only in __register__ then it is dropped before being created again. issue11197 review389881002 --- forecast.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/forecast.py b/forecast.py index f50d507dc7..127f0eff98 100644 --- a/forecast.py +++ b/forecast.py @@ -71,6 +71,7 @@ class Forecast(Workflow, ModelSQL, ModelView): @classmethod def __setup__(cls): super(Forecast, cls).__setup__() + cls.create_date.select = True cls._order.insert(0, ('from_date', 'DESC')) cls._order.insert(1, ('warehouse', 'ASC')) cls._transitions |= set(( @@ -106,9 +107,7 @@ class Forecast(Workflow, ModelSQL, ModelView): super(Forecast, cls).__register__(module_name) - # Add index on create_date table = cls.__table_handler__(module_name) - table.index_action('create_date', action='add') # Migration from 5.0: remove check_from_to_date table.drop_constraint('check_from_to_date')