From 2cc1fba2df981dd819e01784658d30341240aa10 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Tue, 6 Dec 2011 13:31:22 +0100 Subject: [PATCH] [FIX] l10n_multilang: fix (spoken_languages may not be defined on chart template) bzr revid: qdp-launchpad@openerp.com-20111206123122-2cvpmflf1o5ptstc --- addons/l10n_multilang/l10n_multilang.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/addons/l10n_multilang/l10n_multilang.py b/addons/l10n_multilang/l10n_multilang.py index 8897c974b7c..5b69e95eef1 100644 --- a/addons/l10n_multilang/l10n_multilang.py +++ b/addons/l10n_multilang/l10n_multilang.py @@ -95,14 +95,15 @@ class wizard_multi_charts_accounts(osv.osv_memory): res_lang_obj = self.pool.get('res.lang') installed_lang_ids = res_lang_obj.search(cr, uid, []) installed_langs = [x.code for x in res_lang_obj.browse(cr, uid, installed_lang_ids, context=context)] - for lang in obj_multi.chart_template_id.spoken_languages.split(';'): - if lang not in installed_langs: - # the language is not installed, so we don't need to load its translations - continue - else: - # the language was already installed, so the po files have been loaded at the installation time - # and now we need to copy the translations of templates to the right objects - langs.append(lang) + if obj_multi.chart_template_id.spoken_languages: + for lang in obj_multi.chart_template_id.spoken_languages.split(';'): + if lang not in installed_langs: + # the language is not installed, so we don't need to load its translations + continue + else: + # the language was already installed, so the po files have been loaded at the installation time + # and now we need to copy the translations of templates to the right objects + langs.append(lang) if langs: # write account.account translations in the real COA self._process_accounts_translations(cr, uid, obj_multi, company_id, langs, 'name', context=context)