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
This commit is contained in:
1 parent
3ecc008993
commit
b920d6fff4
1 file changed
+1
-2
+1
-2
@@ -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')
|
||||
|
||||
Reference in new issue
Block a user