From df2d42bb30cc5f1d2b8038b4f4d3fc7b9473a506 Mon Sep 17 00:00:00 2001 From: "Laurent Mignon (ACSONE)" Date: Tue, 12 Dec 2023 16:55:09 +0100 Subject: [PATCH] [IMP] connector_search_engine: No prefetch for binding data The field 'data' is a json field that is not used in the view or common management operations of the binding model. This json field can be very large. By disabling the prefetch, we avoid to overload the database and Odoo with useless data. --- connector_search_engine/README.rst | 2 +- connector_search_engine/models/se_binding.py | 2 +- connector_search_engine/readme/newsfragments/179.bugfix | 5 +++++ connector_search_engine/static/description/index.html | 3 ++- 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 connector_search_engine/readme/newsfragments/179.bugfix diff --git a/connector_search_engine/README.rst b/connector_search_engine/README.rst index 0cfa279a..41eb1ff7 100644 --- a/connector_search_engine/README.rst +++ b/connector_search_engine/README.rst @@ -7,7 +7,7 @@ Connector Search Engine !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:547f25e8d231f8513e14b6f643af79a98fccb3853b533b41d4ef36c229d3b7f6 + !! source digest: sha256:d3f9f139fa17b9a02bf4d6648949fa2e1cb38128197922065b0dee912080c288 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/connector_search_engine/models/se_binding.py b/connector_search_engine/models/se_binding.py index ecae8f8b..7eafad78 100644 --- a/connector_search_engine/models/se_binding.py +++ b/connector_search_engine/models/se_binding.py @@ -62,7 +62,7 @@ class SeBinding(models.Model): ) date_recomputed = fields.Datetime(readonly=True) date_synchronized = fields.Datetime(readonly=True) - data = fields.Json(readonly=True) + data = fields.Json(readonly=True, prefetch=False) data_display = fields.Text( compute="_compute_data_display", help="Include this in debug mode to be able to inspect index data.", diff --git a/connector_search_engine/readme/newsfragments/179.bugfix b/connector_search_engine/readme/newsfragments/179.bugfix new file mode 100644 index 00000000..8a121f97 --- /dev/null +++ b/connector_search_engine/readme/newsfragments/179.bugfix @@ -0,0 +1,5 @@ +Lower memory consumption by disabling prefetch for the field 'data' on the binding model. + +The field 'data' is a json field that is not used in the view or common management +operations of the binding model. This json field can be very large. By disabling +the prefetch, we avoid to overload the database and Odoo with useless data. diff --git a/connector_search_engine/static/description/index.html b/connector_search_engine/static/description/index.html index 39efb978..357a6ab7 100644 --- a/connector_search_engine/static/description/index.html +++ b/connector_search_engine/static/description/index.html @@ -1,3 +1,4 @@ + @@ -366,7 +367,7 @@

Connector Search Engine

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:547f25e8d231f8513e14b6f643af79a98fccb3853b533b41d4ef36c229d3b7f6 +!! source digest: sha256:d3f9f139fa17b9a02bf4d6648949fa2e1cb38128197922065b0dee912080c288 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 OCA/search-engine Translate me on Weblate Try me on Runboat

Base module for connecting Odoo with external search engines. This addon is