diff --git a/product/ERP5Type/dynamic/dynamic_module.py b/product/ERP5Type/dynamic/dynamic_module.py index 055c969ddaf70e4cdda96fdaf1b76bb9ee5a641f..b4c4ab906262a6672ee053b258cea9b037b355b6 100644 --- a/product/ERP5Type/dynamic/dynamic_module.py +++ b/product/ERP5Type/dynamic/dynamic_module.py @@ -21,6 +21,11 @@ class DynamicModule(ModuleType): if isinstance(obj, type): # if it's a class we want to set __module__ obj.__module__ = self.__name__ + elif isinstance(obj, ModuleType): + # if it's a module we want to set the name according to the + # module it's being added to + obj.__name__ = "%s.%s" % (self.__name__, name) + setattr(self, name, obj) return obj