diff options
| author | Adrian Torres <adt@odoo.com> | 2019-11-05 10:33:38 +0000 |
|---|---|---|
| committer | fw-bot <otis@odoo.com> | 2019-11-05 18:43:26 +0000 |
| commit | 7affe69117b1b0f252e5cad0ca2523e8a217fbb2 (patch) | |
| tree | 9ac466ea32dda2e45e508f7ec9a4c2815706bc5e | |
| parent | 7ce07a7a1a9244068c88ba316c17b13d1e091af8 (diff) | |
[FIX] base: avoid triggering recomputation when deleted selection
In 6b048a8b8 most issue with trigger causing error when uninstalling a
module were solved.
But there was a particular case if the current uninstallation of modules
there was an update of `ir.model.fields.selection` to be removed. The
unlink of `ir.model.fields.selection` would cause a `setup_models` call
that would add all removed triggers back and possibly down the line
cause an trigger recomputation error.
With this changeset, we do as is already done for ir.model.fields and do
not re-initialize the registry during module uninstallation.
opw-2098915
closes #39796
closes odoo/odoo#39824
X-original-commit: 0ccf2ab8e7f3edabb2d3d4c17a20829de21cca49
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
| -rw-r--r-- | odoo/addons/base/models/ir_model.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/odoo/addons/base/models/ir_model.py b/odoo/addons/base/models/ir_model.py index 34928a421ac..c441929a3ef 100644 --- a/odoo/addons/base/models/ir_model.py +++ b/odoo/addons/base/models/ir_model.py @@ -1179,8 +1179,11 @@ class IrModelSelection(models.Model): result = super().unlink() - # setup models; this re-initializes model in registry - self.pool.setup_models(self._cr) + # Reload registry for normal unlink only. For module uninstall, the + # reload is done independently in odoo.modules.loading. + if not self._context.get(MODULE_UNINSTALL_FLAG): + # setup models; this re-initializes model in registry + self.pool.setup_models(self._cr) return result |
