changeset 75cb41081d90 in modules/purchase:6.2
details: https://hg.tryton.org/modules/purchase?cmd=changeset&node=75cb41081d90
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 17e01ea414a1 -r 75cb41081d90 purchase.py
--- a/purchase.py       Mon Nov 01 17:20:59 2021 +0100
+++ b/purchase.py       Thu Feb 03 22:29:08 2022 +0100
@@ -240,6 +240,7 @@
     @classmethod
     def __setup__(cls):
         super(Purchase, cls).__setup__()
+        cls.create_date.select = True
         cls._order = [
             ('purchase_date', 'DESC NULLS FIRST'),
             ('id', 'DESC'),
@@ -360,9 +361,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