diff --git a/addons/account/models/ir_module.py b/addons/account/models/ir_module.py index 16505aec277..1682cc5a9f3 100644 --- a/addons/account/models/ir_module.py +++ b/addons/account/models/ir_module.py @@ -60,7 +60,7 @@ class IrModule(models.Model): def write(self, vals): # Instanciate the first template of the module on the current company upon installing the module - was_installed = len(self) == 1 and self.state == 'installed' + was_installed = len(self) == 1 and self.state in ('installed', 'to upgrade', 'to remove') super().write(vals) is_installed = len(self) == 1 and self.state == 'installed' if not was_installed and is_installed and not self.env.company.chart_template and self.account_templates: