From 17299012af4c35334b8d87c11c7c658fcfd456da Mon Sep 17 00:00:00 2001 From: Paul Morelle Date: Wed, 16 Sep 2020 09:49:37 +0000 Subject: [PATCH] [FIX] account: fix install of account installs account_accountant Bug description: Installing Invoicing on a database whose company is configured in the SEPA zone, results in installing Accounting Steps to reproduce on the Runbot: - Start from a base enterprise database - Go to Settings > Users & Companies > Companies and configure the address of MyCompany to the SEPA zone (e.g. Belgium) - Go to Apps and install Invoicing - The Accounting application has been installed Explanation: The module account_sepa depends on account_batch_payment, which depends on account_accountant. The post_init_hook of account, _auto_install_l10n, adds the account_sepa module to the installation if the country_code of the company is in the SEPA zone. The same side-effect is observed with account_bank_statement_import_camt which depends on account_bank_statement_import, which depends on account_accountant. The fix is to remove the installation of these modules from the post_init_hook of the module account, and add them to a new post_init_hook of the module account_accountant, that will be in a PR in the enterprise project. closes odoo/odoo#58073 X-original-commit: db4ce56641c75403be935efa072687bff65c7bb2 Related: odoo/enterprise#13362 Signed-off-by: Quentin De Paoli (qdp) Signed-off-by: Paul Morelle --- addons/account/__init__.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/addons/account/__init__.py b/addons/account/__init__.py index 27c64772919..27ffc26d215 100644 --- a/addons/account/__init__.py +++ b/addons/account/__init__.py @@ -62,13 +62,6 @@ def _auto_install_l10n(env): if country_code == 'AU': module_list.append('account_reports_cash_basis') - # SEPA zone countries will be using SEPA - sepa_zone = env.ref('base.sepa_zone', raise_if_not_found=False) - if sepa_zone: - sepa_zone_country_codes = sepa_zone.mapped('country_ids.code') - if country_code in sepa_zone_country_codes: - module_list.append('account_sepa') - module_list.append('account_bank_statement_import_camt') module_ids = env['ir.module.module'].search([('name', 'in', module_list), ('state', '=', 'uninstalled')]) module_ids.sudo().button_install()