From b16507ae2845bd470ce45d90b4fbac7ef9ac1a89 Mon Sep 17 00:00:00 2001 From: william Date: Mon, 21 Feb 2022 10:31:33 +0000 Subject: [PATCH] [FIX] account,l10n_*: always auto_install l10n_*_edi The logic should not be made in the post init hook of account otherwise modules will only get installed like expected during the database initialization, based on the country set on the main company before the installation of `account`. closes odoo/odoo#84975 Related: odoo/enterprise#24576 Signed-off-by: Quentin De Paoli --- addons/account/__init__.py | 8 -------- addons/l10n_be_edi/__manifest__.py | 8 ++++++-- addons/l10n_it_edi/__manifest__.py | 1 + addons/l10n_it_edi_sdicoop/__manifest__.py | 1 + addons/l10n_nl_edi/__manifest__.py | 8 ++++++-- addons/l10n_no_edi/__manifest__.py | 8 ++++++-- addons/l10n_sa_invoice/__manifest__.py | 1 + 7 files changed, 21 insertions(+), 14 deletions(-) diff --git a/addons/account/__init__.py b/addons/account/__init__.py index d3c623f14ad..73a01c9314f 100644 --- a/addons/account/__init__.py +++ b/addons/account/__init__.py @@ -48,19 +48,11 @@ def _auto_install_l10n(env): module_list.append('l10n_' + country_code.lower()) else: module_list.append('l10n_generic_coa') - if country_code in ['US', 'CA']: - module_list.append('account_check_printing') if country_code in SYSCOHADA_LIST + [ 'AT', 'BE', 'CA', 'CO', 'DE', 'EC', 'ES', 'ET', 'FR', 'GR', 'IT', 'LU', 'MX', 'NL', 'NO', 'PL', 'PT', 'RO', 'SI', 'TR', 'GB', 'VE', 'VN' ]: module_list.append('base_vat') - if country_code == 'MX': - module_list.append('l10n_mx_edi') - if country_code == 'IT': - module_list.append('l10n_it_edi_sdicoop') - if country_code == 'SA': - module_list.append('l10n_sa_invoice') module_ids = env['ir.module.module'].search([('name', 'in', module_list), ('state', '=', 'uninstalled')]) module_ids.sudo().button_install() diff --git a/addons/l10n_be_edi/__manifest__.py b/addons/l10n_be_edi/__manifest__.py index 41cc3acb597..d9e661bd9cf 100644 --- a/addons/l10n_be_edi/__manifest__.py +++ b/addons/l10n_be_edi/__manifest__.py @@ -12,12 +12,16 @@ invoices. The UBL standard became the `ISO/IEC 19845 (cf the `official announce `_). Belgian e-invoicing uses the UBL 2.0 using the e-fff protocol. """, - 'depends': ['l10n_be', 'account_edi_ubl'], + 'depends': [ + 'l10n_be', + 'account_edi', + 'account_edi_ubl', + ], 'data': [ 'data/account_edi_data.xml', 'data/ubl_templates.xml', ], 'installable': True, - 'auto_install': True, + 'auto_install': ['l10n_be', 'account_edi'], 'license': 'LGPL-3', } diff --git a/addons/l10n_it_edi/__manifest__.py b/addons/l10n_it_edi/__manifest__.py index 2903042b137..d4d558654f6 100644 --- a/addons/l10n_it_edi/__manifest__.py +++ b/addons/l10n_it_edi/__manifest__.py @@ -10,6 +10,7 @@ 'fetchmail', 'account_edi' ], + 'auto_install': ['l10n_it', 'account_edi'], 'author': 'Odoo', 'description': """ E-invoice implementation diff --git a/addons/l10n_it_edi_sdicoop/__manifest__.py b/addons/l10n_it_edi_sdicoop/__manifest__.py index f67a3f5be5d..d922ad4448f 100644 --- a/addons/l10n_it_edi_sdicoop/__manifest__.py +++ b/addons/l10n_it_edi_sdicoop/__manifest__.py @@ -9,6 +9,7 @@ 'account_edi', 'account_edi_proxy_client', ], + 'auto_install': ['l10n_it_edi'], 'author': 'Odoo', 'description': """ E-invoice implementation for Italy with the web-service. Ability to send and receive document from SdiCoop. Files sent by SdiCoop are first stored on the proxy diff --git a/addons/l10n_nl_edi/__manifest__.py b/addons/l10n_nl_edi/__manifest__.py index 243f8133d5a..7cfd43a5b51 100644 --- a/addons/l10n_nl_edi/__manifest__.py +++ b/addons/l10n_nl_edi/__manifest__.py @@ -8,12 +8,16 @@ 'description': """ NLCIUS is the Dutch implementation of EN 16931 norm. Both for UBL and UN / CEFACT XML CII. """, - 'depends': ['l10n_nl', 'account_edi_ubl_bis3'], + 'depends': [ + 'l10n_nl', + 'account_edi', + 'account_edi_ubl_bis3', + ], 'data': [ 'data/account_edi_data.xml', 'data/nlcius_template.xml', ], 'installable': True, - 'auto_install': True, + 'auto_install': ['l10n_nl', 'account_edi'], 'license': 'LGPL-3', } diff --git a/addons/l10n_no_edi/__manifest__.py b/addons/l10n_no_edi/__manifest__.py index 6df5678bff0..f668da4caaf 100644 --- a/addons/l10n_no_edi/__manifest__.py +++ b/addons/l10n_no_edi/__manifest__.py @@ -8,12 +8,16 @@ 'description': """ EHF 3 is the Norwegian implementation of EN 16931 norm. """, - 'depends': ['l10n_no', 'account_edi_ubl_bis3'], + 'depends': [ + 'l10n_no', + 'account_edi', + 'account_edi_ubl_bis3', + ], 'data': [ 'data/account_edi_data.xml', 'data/ehf_3_template.xml', ], 'installable': True, - 'auto_install': True, + 'auto_install': ['l10n_no', 'account_edi'], 'license': 'LGPL-3', } diff --git a/addons/l10n_sa_invoice/__manifest__.py b/addons/l10n_sa_invoice/__manifest__.py index 399af3cb6a6..7a73534f5e9 100644 --- a/addons/l10n_sa_invoice/__manifest__.py +++ b/addons/l10n_sa_invoice/__manifest__.py @@ -10,6 +10,7 @@ Invoices for the Kingdom of Saudi Arabia """, 'depends': ['l10n_sa', 'l10n_gcc_invoice'], + 'auto_install': ['l10n_sa'], 'data': [ 'views/view_move_form.xml', 'views/report_invoice.xml',