From 85a5a09a53038ec7e42ef10428ba6d2e9dc4e895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 18 Jun 2024 20:41:06 +0200 Subject: [PATCH] Fill models with indexes when database is not updated but indexes Closes #13347 --- trytond/trytond/modules/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/trytond/trytond/modules/__init__.py b/trytond/trytond/modules/__init__.py index 774729327b..cddb7c3c83 100644 --- a/trytond/trytond/modules/__init__.py +++ b/trytond/trytond/modules/__init__.py @@ -231,6 +231,10 @@ def load_module_graph(graph, pool, update=None, lang=None, indexes=True): [[0, CurrentTimestamp(), module, 'activated'], ])) module2state[module] = 'activated' + elif not update and indexes: + for model in classes['model']: + if hasattr(model, '_update_sql_indexes'): + models_with_indexes.add(model.__name__) if not update: pool.setup()