changeset 710f24c7e676 in modules/stock_forecast:5.0
details: 
https://hg.tryton.org/modules/stock_forecast?cmd=changeset&node=710f24c7e676
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 bd11248e930f87db01bb070b6f0dd4ef28c407e8)
diffstat:

 forecast.py |  3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r ce4785a65eb0 -r 710f24c7e676 forecast.py
--- a/forecast.py       Thu Jun 17 22:09:19 2021 +0200
+++ b/forecast.py       Thu Feb 03 22:29:08 2022 +0100
@@ -65,6 +65,7 @@
     @classmethod
     def __setup__(cls):
         super(Forecast, cls).__setup__()
+        cls.create_date.select = True
         t = cls.__table__()
         cls._sql_constraints += [
             ('check_from_to_date', Check(t, t.to_date >= t.from_date),
@@ -108,9 +109,7 @@
     def __register__(cls, module_name):
         super(Forecast, cls).__register__(module_name)
 
-        # Add index on create_date
         table = cls.__table_handler__(module_name)
-        table.index_action('create_date', action='add')
 
     @staticmethod
     def default_state():

Reply via email to