[FIX] registry: fix a bug where RegistryManager.new() could return an out-of-date registry.

bzr revid: vmt@openerp.com-20130212085311-o53wv7yful39kktd
This commit is contained in:
Vo Minh Thu 2013-02-12 09:53:11 +01:00
parent 2d6180c35c
commit e746cb1654
2 changed files with 6 additions and 1 deletions

View File

@ -400,7 +400,7 @@ def load_openerp_module(module_name):
initialize_sys_path()
try:
mod_path = get_module_path(module_name)
zip_mod_path = mod_path + '.zip'
zip_mod_path = '' if not mod_path else mod_path + '.zip'
if not os.path.isfile(zip_mod_path):
__import__('openerp.addons.' + module_name)
else:

View File

@ -216,6 +216,11 @@ class RegistryManager(object):
del cls.registries[db_name]
raise
# load_modules() above can replace the registry by calling
# indirectly new() again (when modules have to be uninstalled).
# Yeah, crazy.
registry = cls.registries[db_name]
cr = registry.db.cursor()
try:
Registry.setup_multi_process_signaling(cr)