Bugs are tracked on GitHub Issues.
+In case of trouble, please check there if your issue has already been reported.
+If you spotted it first, help us to smash it by providing a detailed and welcomed
+feedback.
+
Do not contact contributors directly about support or help with technical issues.
OCA, or the Odoo Community Association, is a nonprofit organization whose
+mission is to support the collaborative development of Odoo features and
+promote its widespread use.
+
+
diff --git a/compute_field_after_install/tests/__init__.py b/compute_field_after_install/tests/__init__.py
new file mode 100644
index 00000000000..2adaf71023c
--- /dev/null
+++ b/compute_field_after_install/tests/__init__.py
@@ -0,0 +1 @@
+from . import test_recompute
diff --git a/compute_field_after_install/tests/test_recompute.py b/compute_field_after_install/tests/test_recompute.py
new file mode 100644
index 00000000000..229a69c22e2
--- /dev/null
+++ b/compute_field_after_install/tests/test_recompute.py
@@ -0,0 +1,51 @@
+# Copyright 2023 Akretion (https://www.akretion.com).
+# @author Sébastien BEAU
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
+
+from unittest.mock import Mock, patch
+
+from odoo.tests import TransactionCase
+from odoo.tools import config
+
+
+class TestRecompute(TransactionCase):
+ @classmethod
+ def setUpClass(cls):
+ super().setUpClass()
+
+ def setUp(self):
+ super().setUp()
+ self.env.cr.commit = Mock()
+
+ def test_add_fields(self):
+ # Simulate the module installation with a computed field
+ records = self.env["res.partner"].search([])
+ with patch.dict(
+ config.options, {"differ_recomputed_field_size": 1}, clear=True
+ ):
+ self.env(context={"module": "fake_module"}).add_to_compute(
+ records._fields["commercial_company_name"], records
+ )
+
+ # Check that a job have been created
+ recompute_field = self.env["recompute.field"].search(
+ [
+ ("model", "=", "res.partner"),
+ ("field", "=", "commercial_company_name"),
+ ]
+ )
+ self.assertEqual(recompute_field.state, "todo")
+
+ # Purge field commercial_company_name to simulate
+ # the installation of a new field
+ self.env.cr.execute("UPDATE res_partner SET commercial_company_name=Null")
+
+ partner = self.env.ref("base.res_partner_address_7")
+ self.assertFalse(partner.commercial_company_name)
+
+ # Run the cron to process computed field
+ self.env["recompute.field"]._run_all()
+ self.assertEqual(recompute_field.state, "done")
+
+ # Check that field have been recomputed correctly
+ self.assertEqual(partner.commercial_company_name, "Ready Mat")
diff --git a/compute_field_after_install/views/recompute_field_view.xml b/compute_field_after_install/views/recompute_field_view.xml
new file mode 100644
index 00000000000..a4b73f95d11
--- /dev/null
+++ b/compute_field_after_install/views/recompute_field_view.xml
@@ -0,0 +1,75 @@
+
+
+
+
+ recompute.field
+
+
+
+
+
+
+
+
+
+
+
+
+
+ recompute.field
+
+
+
+
+
+
+ recompute.field
+
+
+
+
+
+
+
+
+
+
+
+ Recompute Field
+ ir.actions.act_window
+ recompute.field
+ tree,form
+
+ []
+ {}
+
+
+
+
+
From 7ea0486acdc0a6b372520f055a50524d97f90b67 Mon Sep 17 00:00:00 2001
From: Florian Mounier
Date: Mon, 6 Jan 2025 13:31:34 +0100
Subject: [PATCH 2/9] [MIG] compute_field_after_install to 16.0
---
compute_field_after_install/__manifest__.py | 18 +++++-------------
compute_field_after_install/data/ir_cron.xml | 7 ++++++-
.../models/recompute_field.py | 9 +++++----
.../tests/test_recompute.py | 2 +-
.../views/recompute_field_view.xml | 5 +++++
5 files changed, 22 insertions(+), 19 deletions(-)
diff --git a/compute_field_after_install/__manifest__.py b/compute_field_after_install/__manifest__.py
index 25380213050..ecc8ececdaa 100644
--- a/compute_field_after_install/__manifest__.py
+++ b/compute_field_after_install/__manifest__.py
@@ -1,23 +1,17 @@
-# Copyright 2016 Akretion (http://www.akretion.com)
+# Copyright 2025 Akretion (http://www.akretion.com)
# Sébastien BEAU
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
- "name": "Base compute field after install",
- "summary": "Computed field are computed after the install process",
- "version": "14.0.1.0.0",
- "category": "e-commerce",
+ "name": "Compute field after install",
+ "summary": "Compute computed fields after the install process",
+ "version": "16.0.1.0.0",
+ "category": "Tools",
"website": "https://github.com/OCA/server-tools",
"author": "Akretion,Odoo Community Association (OCA)",
"maintainers": ["sebastienbeau"],
"license": "AGPL-3",
- "application": False,
"installable": True,
- "auto_install": False,
- "external_dependencies": {
- "python": [],
- "bin": [],
- },
"depends": [
"base",
],
@@ -26,6 +20,4 @@
"views/recompute_field_view.xml",
"security/ir.model.access.csv",
],
- "demo": [],
- "qweb": [],
}
diff --git a/compute_field_after_install/data/ir_cron.xml b/compute_field_after_install/data/ir_cron.xml
index dad037444fe..c3d31d3e05c 100644
--- a/compute_field_after_install/data/ir_cron.xml
+++ b/compute_field_after_install/data/ir_cron.xml
@@ -1,4 +1,9 @@
-
+
+
diff --git a/compute_field_after_install/models/recompute_field.py b/compute_field_after_install/models/recompute_field.py
index 1f0927ede0a..b377b338fcd 100644
--- a/compute_field_after_install/models/recompute_field.py
+++ b/compute_field_after_install/models/recompute_field.py
@@ -1,13 +1,13 @@
-# Copyright 2017 Akretion (http://www.akretion.com).
+# Copyright 2025 Akretion (http://www.akretion.com).
# @author Sébastien BEAU
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import logging
-from openerp import api, fields, models
-from openerp.exceptions import Warning as UserError
-from openerp.tools.translate import _
+from odoo import api, fields, models
+from odoo.exceptions import Warning as UserError
+from odoo.tools.translate import _
from odoo.tools import config
@@ -77,6 +77,7 @@ def add_to_compute(self, field, records):
"recompute.field" in self
and len(records) > config.get("differ_recomputed_field_size", 50000)
and self.context.get("module")
+ and not getattr(field, "precompute", False)
):
_logger.info(
"Differs recomputation of field %s for model %s as there is %s records",
diff --git a/compute_field_after_install/tests/test_recompute.py b/compute_field_after_install/tests/test_recompute.py
index 229a69c22e2..912b7fbb3e6 100644
--- a/compute_field_after_install/tests/test_recompute.py
+++ b/compute_field_after_install/tests/test_recompute.py
@@ -1,4 +1,4 @@
-# Copyright 2023 Akretion (https://www.akretion.com).
+# Copyright 2025 Akretion (https://www.akretion.com).
# @author Sébastien BEAU
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
diff --git a/compute_field_after_install/views/recompute_field_view.xml b/compute_field_after_install/views/recompute_field_view.xml
index a4b73f95d11..8de4e1d97e4 100644
--- a/compute_field_after_install/views/recompute_field_view.xml
+++ b/compute_field_after_install/views/recompute_field_view.xml
@@ -1,4 +1,9 @@
+
From cb69711e5166590160cba0357633ef12d8e80209 Mon Sep 17 00:00:00 2001
From: Florian Mounier
Date: Mon, 6 Jan 2025 13:59:14 +0100
Subject: [PATCH 3/9] [IMP] compute_field_after_install Use per model/field
config
Improve doc, improve unit tests
---
compute_field_after_install/README.rst | 25 +--
.../models/recompute_field.py | 61 +++++---
.../readme/CONFIGURATION.rst | 27 +++-
.../readme/CONTRIBUTORS.rst | 1 +
.../readme/DESCRIPTION.rst | 8 +-
.../static/description/index.html | 33 ++--
.../tests/test_recompute.py | 144 +++++++++++++++++-
7 files changed, 238 insertions(+), 61 deletions(-)
diff --git a/compute_field_after_install/README.rst b/compute_field_after_install/README.rst
index 10798d7aecf..7c16e3ead0e 100644
--- a/compute_field_after_install/README.rst
+++ b/compute_field_after_install/README.rst
@@ -1,6 +1,6 @@
-================================
-Base compute field after install
-================================
+===========================
+Compute field after install
+===========================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -17,22 +17,22 @@ Base compute field after install
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github
- :target: https://github.com/OCA/server-tools/tree/14.0/base_compute_field_after_install
+ :target: https://github.com/OCA/server-tools/tree/16.0/compute_field_after_install
:alt: OCA/server-tools
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/server-tools-14-0/server-tools-14-0-base_compute_field_after_install
+ :target: https://translation.odoo-community.org/projects/server-tools-16-0/server-tools-16-0-compute_field_after_install
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
- :target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=14.0
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
-Computed field can be really long to be computed when installing a module and so block
-the migration process during a long time.
+Computed field computation can be a really long process when installing a module and
+can block the migration process for a long time.
-This module give the possibility to compute
-the field added after the installation
+This module gives the possibility to defer the field computation after
+the installation.
**Table of contents**
@@ -52,7 +52,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -68,6 +68,7 @@ Contributors
~~~~~~~~~~~~
* Sébastien BEAU
+* Florian Mounier
Maintainers
~~~~~~~~~~~
@@ -90,6 +91,6 @@ Current `maintainer `__:
|maintainer-sebastienbeau|
-This module is part of the `OCA/server-tools `_ project on GitHub.
+This module is part of the `OCA/server-tools `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/compute_field_after_install/models/recompute_field.py b/compute_field_after_install/models/recompute_field.py
index b377b338fcd..145c9ba3f5c 100644
--- a/compute_field_after_install/models/recompute_field.py
+++ b/compute_field_after_install/models/recompute_field.py
@@ -21,9 +21,17 @@ class RecomputeField(models.Model):
model = fields.Char(required=True)
field = fields.Char(required=True)
last_id = fields.Integer(
- string="Last ID", help="Last record ID on which computing have been executed"
+ help="Last record ID on which computing have been executed"
+ )
+
+ step = fields.Integer(
+ required=True,
+ help="Recomputing batch size.",
+ compute="_compute_default_step",
+ store=True,
+ readonly=False,
+ precompute=True,
)
- step = fields.Integer(required=True, default=1000, help="Recomputing batch size.")
state = fields.Selection(
[
("todo", "Todo"),
@@ -31,6 +39,24 @@ class RecomputeField(models.Model):
]
)
+ @api.depends("model", "field")
+ def _compute_default_step(self):
+ for recompute_field in self:
+ model = recompute_field.model.replace(".", "_")
+ recompute_field.step = config.get(
+ f"computed_fields_batch_size__{model}__{recompute_field.field}",
+ config.get(
+ f"computed_fields_batch_size__{model}",
+ config.get("computed_fields_batch_size", 1000),
+ ),
+ )
+
+ @api.constrains("step")
+ def _check_step(self):
+ for recompute_field in self:
+ if recompute_field.step <= 0:
+ raise UserError(_("Step must be greater than 0"))
+
@api.model
def _run_all(self):
return self.search([("state", "=", "todo")]).run()
@@ -38,34 +64,31 @@ def _run_all(self):
def run(self):
for task in self:
cursor = self.env.cr
- offset = 0
model = self.env[task.model]
- if task.last_id:
- domain = [("id", ">", task.last_id)]
- else:
- domain = []
- if task.step <= 0:
- raise UserError(_("Step must be upper than 0"))
- else:
- limit = task.step
+
while True:
_logger.info(
- "Recompute field %s for model %s in background. Offset %s",
+ "Recompute field %s for model %s in background. Last id %d",
task.field,
task.model,
- offset,
+ task.last_id,
+ )
+ records = model.search(
+ [("id", "<", task.last_id)] if task.last_id else [],
+ limit=task.step,
+ order="id desc",
)
- records = model.search(domain, limit=limit, offset=offset, order="id")
if not records:
+ task.state = "done"
+ cursor.commit()
break
- offset += limit
+
field = records._fields[task.field]
self.env.add_to_compute(field, records)
records.recompute()
task.last_id = records[-1].id
cursor.commit()
- task.state = "done"
- cursor.commit()
+
return True
@@ -75,12 +98,12 @@ def run(self):
def add_to_compute(self, field, records):
if (
"recompute.field" in self
- and len(records) > config.get("differ_recomputed_field_size", 50000)
+ and len(records) > config.get("computed_fields_defer_threshold", 50000)
and self.context.get("module")
and not getattr(field, "precompute", False)
):
_logger.info(
- "Differs recomputation of field %s for model %s as there is %s records",
+ "Deferring computation of field %s for model %s as there is %s records",
field.name,
records._name,
len(records),
diff --git a/compute_field_after_install/readme/CONFIGURATION.rst b/compute_field_after_install/readme/CONFIGURATION.rst
index 56206472f28..1a319da11e0 100644
--- a/compute_field_after_install/readme/CONFIGURATION.rst
+++ b/compute_field_after_install/readme/CONFIGURATION.rst
@@ -1,9 +1,20 @@
-The module can be installed just like any other Odoo module, by adding the
-module's directory to Odoo *addons_path*. In order for the module to correctly
-wrap the Odoo WSGI application, it also needs to be loaded as a server-wide
-module. This can be done with the ``server_wide_modules`` parameter in your
-Odoo config file or with the ``--load`` command-line parameter.
+This module can be installed just like any other Odoo module, by adding it
+to Odoo *addons_path*. In order for the module to work correctly,
+it needs to be loaded as a server-wide module.
+This can be done with the ``server_wide_modules`` parameter in your Odoo config
+file or with the ``--load`` command-line parameter.
-Additionnaly you can customize the number of record in a table that differs the
-fields recomputation adding the following variable in the odoo config file
-``differ_recomputed_field_size=20000``
+Additionnaly you can customize the minimum number of records that will defer the
+fields computation by adding the following variable in the odoo config file
+``computed_fields_defer_threshold=20000``
+
+You can also customize the batch size of the fields computation by adding
+the following variable in the odoo config file
+``computed_fields_batch_size=1000`` or more specifically for a model
+``computed_fields_batch_size__=1000`` and for a specific model field
+``computed_fields_batch_size____=1000``
+
+i.e.:
+``computed_fields_batch_size__res_partner=2000``
+``computed_fields_batch_size__res_partner__commercial_company_name=50``
+
\ No newline at end of file
diff --git a/compute_field_after_install/readme/CONTRIBUTORS.rst b/compute_field_after_install/readme/CONTRIBUTORS.rst
index 9e0ae5f27a3..b822a2505b6 100644
--- a/compute_field_after_install/readme/CONTRIBUTORS.rst
+++ b/compute_field_after_install/readme/CONTRIBUTORS.rst
@@ -1 +1,2 @@
* Sébastien BEAU
+* Florian Mounier
diff --git a/compute_field_after_install/readme/DESCRIPTION.rst b/compute_field_after_install/readme/DESCRIPTION.rst
index e7ff8353558..b9a98d1fc77 100644
--- a/compute_field_after_install/readme/DESCRIPTION.rst
+++ b/compute_field_after_install/readme/DESCRIPTION.rst
@@ -1,5 +1,5 @@
-Computed field can be really long to be computed when installing a module and so block
-the migration process during a long time.
+Computed field computation can be a really long process when installing a module and
+can block the migration process for a long time.
-This module give the possibility to compute
-the field added after the installation
+This module gives the possibility to defer the field computation after
+the installation.
diff --git a/compute_field_after_install/static/description/index.html b/compute_field_after_install/static/description/index.html
index 885592a3707..4fcb4e80f97 100644
--- a/compute_field_after_install/static/description/index.html
+++ b/compute_field_after_install/static/description/index.html
@@ -1,18 +1,18 @@
-
-Base compute field after install
+Compute field after install
-
-
Base compute field after install
+
+
Compute field after install
-
-
Computed field can be really long to be computed when installing a module and so block
-the migration process during a long time.
-
This module give the possibility to compute
-the field added after the installation
+
+
Computed field computation can be a really long process when installing a module and
+can block the migration process for a long time.
+
This module gives the possibility to defer the field computation after
+the installation.
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-feedback.
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-feedback.
diff --git a/compute_field_after_install/views/recompute_field_view.xml b/compute_field_after_install/views/recompute_field_view.xml
index 8de4e1d97e4..d4a4e232a89 100644
--- a/compute_field_after_install/views/recompute_field_view.xml
+++ b/compute_field_after_install/views/recompute_field_view.xml
@@ -5,7 +5,6 @@
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
-
recompute.field
@@ -76,5 +75,4 @@
sequence="100"
action="act_open_recompute_field_view"
/>
-
From 33f9a0d3dd493fd854e0d8ef8aecd735a553f0c0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Alix?=
Date: Wed, 10 Jun 2026 15:41:47 +0200
Subject: [PATCH 8/9] [MIG] compute_field_after_install: Migration to 18.0
---
compute_field_after_install/__manifest__.py | 2 +-
compute_field_after_install/data/ir_cron.xml | 2 --
.../models/recompute_field.py | 20 +++++++++----------
.../tests/test_recompute.py | 16 ++++++++++-----
.../views/recompute_field_view.xml | 10 +++++-----
5 files changed, 27 insertions(+), 23 deletions(-)
diff --git a/compute_field_after_install/__manifest__.py b/compute_field_after_install/__manifest__.py
index ecc8ececdaa..b84b5f741ed 100644
--- a/compute_field_after_install/__manifest__.py
+++ b/compute_field_after_install/__manifest__.py
@@ -5,7 +5,7 @@
{
"name": "Compute field after install",
"summary": "Compute computed fields after the install process",
- "version": "16.0.1.0.0",
+ "version": "18.0.1.0.0",
"category": "Tools",
"website": "https://github.com/OCA/server-tools",
"author": "Akretion,Odoo Community Association (OCA)",
diff --git a/compute_field_after_install/data/ir_cron.xml b/compute_field_after_install/data/ir_cron.xml
index 4f0e8b91b65..6c660ea952c 100644
--- a/compute_field_after_install/data/ir_cron.xml
+++ b/compute_field_after_install/data/ir_cron.xml
@@ -11,8 +11,6 @@
30minutes
- -1
- codemodel._run_all()
diff --git a/compute_field_after_install/models/recompute_field.py b/compute_field_after_install/models/recompute_field.py
index 717580ac640..bfa0c159fff 100644
--- a/compute_field_after_install/models/recompute_field.py
+++ b/compute_field_after_install/models/recompute_field.py
@@ -8,7 +8,7 @@
from itertools import groupby
from odoo import api, fields, models
-from odoo.exceptions import Warning as UserError
+from odoo.exceptions import UserError
from odoo.tools import config
from odoo.tools.translate import _
@@ -63,7 +63,8 @@ def _run_all(self):
return self.search([("state", "=", "todo")]).run()
def run(self):
- # Group tasks by compute method to avoid computing multifields computes multiple times
+ # Group tasks by compute method to avoid computing multifields
+ # computes multiple times
def group_key(task):
return task.model, str(self.env[task.model]._fields[task.field].compute)
@@ -122,14 +123,13 @@ def add_to_compute(self, field, records):
records._name,
len(records),
)
- with self.norecompute():
- self["recompute.field"].create(
- {
- "field": field.name,
- "model": records._name,
- "state": "todo",
- }
- )
+ self["recompute.field"].create(
+ {
+ "field": field.name,
+ "model": records._name,
+ "state": "todo",
+ }
+ )
else:
return ori_add_to_compute(self, field, records)
diff --git a/compute_field_after_install/tests/test_recompute.py b/compute_field_after_install/tests/test_recompute.py
index fdadcc13925..5b2ec186d0b 100644
--- a/compute_field_after_install/tests/test_recompute.py
+++ b/compute_field_after_install/tests/test_recompute.py
@@ -2,6 +2,7 @@
# @author Sébastien BEAU
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
+import math
from contextlib import contextmanager
from unittest.mock import Mock, patch
@@ -112,7 +113,7 @@ def test_add_fields_batch(self):
) as computed:
self.env["recompute.field"]._run_all()
self.assertEqual(computed["records"], len(records))
- self.assertEqual(computed["calls"], len(records) // 10 + 1)
+ self.assertEqual(computed["calls"], math.ceil(len(records) / 10.0))
self.assertEqual(recompute_field.state, "done")
# Check that field have been recomputed correctly
@@ -173,11 +174,13 @@ def test_default_step(self):
)
self.assertEqual(recompute_field.step, 3000)
+ option_key = (
+ "computed_fields_batch_size"
+ "__res_partner__commercial_company_name"
+ )
with patch.dict(
config.options,
- {
- "computed_fields_batch_size__res_partner__commercial_company_name": 4000
- },
+ {option_key: 4000},
clear=True,
):
recompute_field = self.env["recompute.field"].create(
@@ -219,7 +222,10 @@ def test_multifields(self):
# Purge field commercial_company_name to simulate
# the installation of a new field
self.env.cr.execute(
- "UPDATE sale_order SET amount_untaxed=null, amount_tax=null, amount_total=null"
+ """
+ UPDATE sale_order
+ SET amount_untaxed=null, amount_tax=null, amount_total=null
+ """
)
self.env.invalidate_all()
diff --git a/compute_field_after_install/views/recompute_field_view.xml b/compute_field_after_install/views/recompute_field_view.xml
index d4a4e232a89..def5851abf3 100644
--- a/compute_field_after_install/views/recompute_field_view.xml
+++ b/compute_field_after_install/views/recompute_field_view.xml
@@ -8,7 +8,7 @@
recompute.field
-
+
@@ -17,11 +17,11 @@
-
+
@@ -38,7 +38,7 @@
@@ -63,7 +63,7 @@
Recompute Fieldir.actions.act_windowrecompute.field
- tree,form
+ list,form[]{}
From 8ae40a5233dffbaf7bfb59dff293b83e87174853 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Alix?=
Date: Thu, 11 Jun 2026 08:49:35 +0200
Subject: [PATCH 9/9] [IMP] compute_field_after_install: add warning section in
module description
---
compute_field_after_install/README.rst | 9 +++++++++
compute_field_after_install/readme/DESCRIPTION.md | 9 +++++++++
.../static/description/index.html | 7 +++++++
3 files changed, 25 insertions(+)
diff --git a/compute_field_after_install/README.rst b/compute_field_after_install/README.rst
index 6dbd93d999c..1d359c9f7d0 100644
--- a/compute_field_after_install/README.rst
+++ b/compute_field_after_install/README.rst
@@ -34,6 +34,15 @@ a module and can block the migration process for a long time.
This module gives the possibility to defer the field computation after
the installation.
+⚠️ Use with caution ⚠️
+
+Not all computed fields can be deferred without risking the generation
+of corrupted data. E.g. the total amount of an invoice, if differed,
+could lead to wrong data computation in other stored fields that depend
+on it. That's why this module should never be used in a database
+migration process such as OpenUpgrade, where computed fields have to be
+triggered by the framework as expected.
+
**Table of contents**
.. contents::
diff --git a/compute_field_after_install/readme/DESCRIPTION.md b/compute_field_after_install/readme/DESCRIPTION.md
index 44f71fb2335..2c53d8fa64e 100644
--- a/compute_field_after_install/readme/DESCRIPTION.md
+++ b/compute_field_after_install/readme/DESCRIPTION.md
@@ -3,3 +3,12 @@ a module and can block the migration process for a long time.
This module gives the possibility to defer the field computation after
the installation.
+
+:warning: Use with caution :warning:
+
+Not all computed fields can be deferred without risking the generation of
+corrupted data. E.g. the total amount of an invoice, if differed, could lead
+to wrong data computation in other stored fields that depend on it. That's why
+this module should never be used in a database migration process such as
+OpenUpgrade, where computed fields have to be triggered by the framework
+as expected.
diff --git a/compute_field_after_install/static/description/index.html b/compute_field_after_install/static/description/index.html
index d6e8773e0df..7a04e7fc3cf 100644
--- a/compute_field_after_install/static/description/index.html
+++ b/compute_field_after_install/static/description/index.html
@@ -374,6 +374,13 @@
Compute field after install
a module and can block the migration process for a long time.
This module gives the possibility to defer the field computation after
the installation.
+
⚠️ Use with caution ⚠️
+
Not all computed fields can be deferred without risking the generation
+of corrupted data. E.g. the total amount of an invoice, if differed,
+could lead to wrong data computation in other stored fields that depend
+on it. That’s why this module should never be used in a database
+migration process such as OpenUpgrade, where computed fields have to be
+triggered by the framework as expected.