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
(grafted from 4d2ae547c0a2512afea385dfeed074e524eb4c4b)

--HG--
branch : 6.0
This commit is contained in:
Cédric Krier committed 2022-02-03 22:29:08 +01:00
1 parent fb2a47a1b7
commit 284b9a005f
1 file changed
+1 -3
+1 -3
View File
@@ -282,6 +282,7 @@ class Sale(
@classmethod
def __setup__(cls):
super(Sale, cls).__setup__()
cls.create_date.select = True
cls._order = [
('sale_date', 'DESC NULLS FIRST'),
('id', 'DESC'),
@@ -364,9 +365,6 @@ class Sale(
# Migration from 4.0: Drop not null on payment_term
table.not_null_action('payment_term', 'remove')
# Add index on create_date
table.index_action('create_date', action='add')
# Migration from 5.6: rename state cancel to cancelled
cursor.execute(*sql_table.update(
[sql_table.state], ['cancelled'],