From 863785242d6d01fbccdd943666b10596792a5513 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 15 Jan 2009 17:28:15 +0100 Subject: [FIX] avoid a crash when installing a language for a non present but installed module lp bug: https://launchpad.net/bugs/314449 fixed bzr revid: christophe@tinyerp.com-20090115162815-xjnwwrgn211p5sa3 --- bin/addons/base/module/module.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'bin/addons/base/module') diff --git a/bin/addons/base/module/module.py b/bin/addons/base/module/module.py index 35c1e9f48ca..a4f822a5e16 100644 --- a/bin/addons/base/module/module.py +++ b/bin/addons/base/module/module.py @@ -462,9 +462,12 @@ class module(osv.osv): for mod in self.browse(cr, uid, ids): if mod.state != 'installed': continue - + modpath = addons.get_module_path(mod.name) + if not modpath: + # unable to find the module. we skip + continue for lang in filter_lang: - f = os.path.join(addons.get_module_path(mod.name), 'i18n', lang + '.po') + f = os.path.join(modpath, 'i18n', lang + '.po') if os.path.exists(f): logger.notifyChannel("init", netsvc.LOG_INFO, 'module %s: loading translation file for language %s' % (mod.name, lang)) tools.trans_load(cr.dbname, f, lang, verbose=False) -- cgit v1.2.3