From ae5fcfe03bf8d0ba3ee4c628da1a173f4983155f Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Tue, 13 Jun 2017 09:55:44 +0200 Subject: [PATCH] Delete missing modules not activated when updating module list issue6472 review42271002 --- CHANGELOG | 1 + trytond/ir/module.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 474ab85fb2..7945823fda 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Delete missing modules not activated when updating module list * Remove empty pages from notebook * Allow to store Dict as JSON on the database diff --git a/trytond/ir/module.py b/trytond/ir/module.py index 63f2cb3dd1..b666f5f513 100644 --- a/trytond/ir/module.py +++ b/trytond/ir/module.py @@ -285,6 +285,8 @@ class Module(ModelSQL, ModelView): modules = cls.search([]) name2module = dict((m.name, m) for m in modules) + cls.delete([m for m in modules + if m.state != 'activated' and m.name not in module_names]) # iterate through activated modules and mark them as being so for name in module_names: