From 57cbb9be3eddae6dde3c4e0c4cb121ebb40b92cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 3 Feb 2022 22:29:08 +0100 Subject: [PATCH] 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 --- invoice.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/invoice.py b/invoice.py index 5d74cea729..f49a47f58e 100644 --- a/invoice.py +++ b/invoice.py @@ -266,6 +266,7 @@ class Invoice(Workflow, ModelSQL, ModelView, TaxableMixin): @classmethod def __setup__(cls): super(Invoice, cls).__setup__() + cls.create_date.select = True cls._check_modify_exclude = { 'state', 'payment_lines', 'move', 'cancel_move', 'additional_moves', 'invoice_report_cache', @@ -410,9 +411,6 @@ class Invoice(Workflow, ModelSQL, ModelView, TaxableMixin): # 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'],