changeset e5f86ebc54b1 in modules/purchase:5.0
details: https://hg.tryton.org/modules/purchase?cmd=changeset&node=e5f86ebc54b1
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 15d932b58b29 -r e5f86ebc54b1 purchase.py
--- a/purchase.py       Fri Nov 05 00:12:40 2021 +0100
+++ b/purchase.py       Thu Feb 03 22:29:08 2022 +0100
@@ -193,6 +193,7 @@
     @classmethod
     def __setup__(cls):
         super(Purchase, cls).__setup__()
+        cls.create_date.select = True
         cls._order = [
             ('purchase_date', 'DESC'),
             ('id', 'DESC'),
@@ -316,9 +317,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')
-
     @classmethod
     def default_payment_term(cls):
         PaymentTerm = Pool().get('account.invoice.payment_term')

Reply via email to