Files
odoo_source/odoo/addons/test_main_flows/__init__.py
T
Lucas Perais e08ddc21a6 [FIX] web: reload on usable view when switch company does AccessError
Be logged in multiple companies (A and B).
Be on a form view of some record which is visible only on company B via ir.rules.

With the company switcher, unlog from company B.

Before this commit, the user received an AccessError and arrived on a blank webclient.
To say the least, it was rather inelegant.

After this commit, the user ends up on the multi-record view of that model, provided that it is available for use.

Task-3029616

closes odoo/odoo#141796

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-17 16:11:50 +00:00

16 lines
698 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from .models import model_multicompany
#
# Conditional installation of enterprise modules.
#
# This module is defined in community but some steps (defined with 'edition: "enterprise"')
# are only used to test enterprise. As it's not possible to direcly add enterprise
# modules dependencies, this post install hook will install account_accountant if exists.
#
def _auto_install_enterprise_dependencies(env):
module_list = ['account_accountant']
module_ids = env['ir.module.module'].search([('name', 'in', module_list), ('state', '=', 'uninstalled')])
module_ids.sudo().button_install()