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:
Cédric Krier
2022-02-03 22:29:08 +01:00
parent 4497c3897d
commit d9baeb19f0
+1 -3
View File
@@ -89,6 +89,7 @@ class Move(ModelSQL, ModelView):
@classmethod
def __setup__(cls):
super(Move, cls).__setup__()
cls.create_date.select = True
cls._check_modify_exclude = ['lines']
cls._order.insert(0, ('date', 'DESC'))
cls._order.insert(1, ('number', 'DESC'))
@@ -130,9 +131,6 @@ class Move(ModelSQL, ModelView):
table = cls.__table_handler__(module_name)
table.index_action(['journal', 'period'], 'add')
# Add index on create_date
table.index_action('create_date', action='add')
@classmethod
def order_post_number(cls, tables):
table, _ = tables[None]