[FIX] account: do not call button_install is not necessary
If the method `_auto_install_l10n` is called programmatically on a DB where the localization has already been installed, useless processing is performed by `button_install`. Do not call this method if no module need to be installed. closes odoo/odoo#106419 X-original-commit: 11e9d3f1a9e8c85fa85a86f0a63935250552a19f Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
@@ -56,7 +56,8 @@ def _auto_install_l10n(env):
|
||||
module_list.append('base_vat')
|
||||
|
||||
module_ids = env['ir.module.module'].search([('name', 'in', module_list), ('state', '=', 'uninstalled')])
|
||||
module_ids.sudo().button_install()
|
||||
if module_ids:
|
||||
module_ids.sudo().button_install()
|
||||
|
||||
def _account_post_init(cr, registry):
|
||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||
|
||||
Reference in New Issue
Block a user