diff --git a/trytond/module.py b/trytond/module.py index 215c57ea0f..46de17bfb5 100644 --- a/trytond/module.py +++ b/trytond/module.py @@ -76,7 +76,7 @@ class Node(Singleton): def __setattr__(self, name, value): super(Node, self).__setattr__(name, value) - if name in ('init', 'update'): + if name in ('init', 'update', 'demo'): CONFIG[name][self.name] = 1 for child in self.childs: setattr(child, name, value) @@ -276,12 +276,18 @@ def load_modules(database, force_demo=False, update_module=False, lang=None): cursor.execute("SELECT name FROM ir_module_module " \ "WHERE state IN ('installed', 'to upgrade', 'to remove')") module_list = [name for (name,) in cursor.fetchall()] + for module in CONFIG['init'].keys(): + if CONFIG['init'][module]: + module_list.append(module) + for module in CONFIG['update'].keys(): + if CONFIG['update'][module]: + module_list.append(module) graph = create_graph(module_list, force) load_module_graph(cursor, graph, lang) - for kind in ('init', 'update'): + for kind in ('init', 'update', 'demo'): CONFIG[kind] = {} if update_module: diff --git a/trytond/trytond.py b/trytond/trytond.py index b0f2b64857..f431f79511 100644 --- a/trytond/trytond.py +++ b/trytond/trytond.py @@ -81,7 +81,7 @@ class TrytonServer(object): self.logger.notify_channel("init", netsvc.LOG_INFO, "could not connect to database '%s'!" % db_name,) - if cursor and CONFIG['init'] and CONFIG['init']['all']: + if cursor and CONFIG['init']: cursor.execute("SELECT relname " \ "FROM pg_class " \ "WHERE relkind = 'r' AND relname in (" \ @@ -109,8 +109,6 @@ class TrytonServer(object): if len(cursor.fetchall()) == 0: self.logger.notify_channel("init", netsvc.LOG_INFO, "init db") sql_db.init_db(cursor) - if not CONFIG['without_demo']: - CONFIG["demo"]['all'] = 1 cursor.commit() register_classes()