OCA / multi-company

GNU Affero General Public License v3.0
100 stars 281 forks source link

partner_multi_company restores wrong ir.rule #499

Closed lorenzoallegrucci closed 1 year ago

lorenzoallegrucci commented 1 year ago

Module

partner_multi_company

Describe the bug

When uninstalled, this module restores a wrong ir.rule, in particular it restores an old version of base.res_partner_rule

To Reproduce

Affected versions:

Steps to reproduce the behavior:

  1. Install the module
  2. Uninstall the mudule
  3. Check base.res_partner_rule

Expected behavior On uninstall it is expected this module would restore the original odoo14 base.res_partner_rule, it restores an old version of it instead This is the standard updated odoo14 rule I expect to be restored: https://github.com/odoo/odoo/blob/14.0/odoo/addons/base/security/base_security.xml#L16

                "domain_force": (
                    "['|', '|', ('partner_share', '=', False), "
                    "('company_id', 'in', company_ids), "
                    "('company_id', '=', False)]"
                ),

This is what is actually restored, and I think "active" False is also wrong

                "active": False,
                "domain_force": (
                    " ['|', ('company_id', '=', user.company_id.id),"
                    " ('company_id', '=', False)]"
                ),

Additional context