From b84c846fe48f044d27b67c4816f043579d8a1460 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 16 Mar 2023 14:40:09 +0000 Subject: [PATCH] [FIX] account: handle upgrade of modules closes odoo/odoo#116762 X-original-commit: 892db541b9474b2fc4ed4da36f1917720a07d1e4 Signed-off-by: Christophe Simonis --- addons/account/models/ir_module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: