From ea12117f6579881e6eecbd1df058eb7850f56b84 Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Tue, 27 Oct 2015 10:44:36 +0100 Subject: [PATCH] [IMP] account: auto-install 'l10n_uk' for country code 'GB'. Auto install 'l10n_generic_coa' if there is no dedicated localization found for the country code --- addons/account/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/account/__init__.py b/addons/account/__init__.py index 1ef28915c64..4c7c83661e2 100644 --- a/addons/account/__init__.py +++ b/addons/account/__init__.py @@ -16,8 +16,13 @@ def _auto_install_l10n(cr, registry): if country_code in ['BJ', 'BF', 'CM', 'CF', 'KM', 'CG', 'CI', 'GA', 'GN', 'GW', 'GQ', 'ML', 'NE', 'CD', 'SN', 'TD', 'TG']: #countries using OHADA Chart of Accounts module_list.append('l10n_syscohada') + elif country_code == 'GB': + module_list.append('l10n_uk') else: - module_list.append('l10n_' + country_code.lower()) + if registry['ir.module.module'].search(cr, SUPERUSER_ID, [('name', '=', 'l10n_' + country_code.lower())]): + module_list.append('l10n_' + country_code.lower()) + else: + module_list.append('l10n_generic_coa') if country_code == 'US': module_list.append('account_plaid') module_list.append('account_check_printing')