[FIX] account: handle upgrade of modules
closes odoo/odoo#116762 X-original-commit: 892db541b9474b2fc4ed4da36f1917720a07d1e4 Signed-off-by: Christophe Simonis <chs@odoo.com>
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user