changeset 89c895b57661 in modules/purchase:6.0
details: https://hg.tryton.org/modules/purchase?cmd=changeset&node=89c895b57661
description:
        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 b6547efd68b65333187775ad1a01416bee2e3043)
diffstat:

 purchase.py |  4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diffs (21 lines):

diff -r e5d67d7913cf -r 89c895b57661 purchase.py
--- a/purchase.py       Fri Nov 05 00:12:01 2021 +0100
+++ b/purchase.py       Thu Feb 03 22:29:08 2022 +0100
@@ -243,6 +243,7 @@
     @classmethod
     def __setup__(cls):
         super(Purchase, cls).__setup__()
+        cls.create_date.select = True
         cls._order = [
             ('purchase_date', 'DESC NULLS FIRST'),
             ('id', 'DESC'),
@@ -363,9 +364,6 @@
                     values=['processing'],
                     where=sql_table.id.in_(sub_query.select(sub_query.id))))
 
-        # 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'],

Reply via email to