From d86c2c588367dee319649ab2a5890975c1bcb916 Mon Sep 17 00:00:00 2001 From: Arnold Moyaux Date: Tue, 1 Oct 2019 12:58:03 +0000 Subject: [PATCH] [FIX] base: res_users in multi company MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Usecase to reproduce: - User1 in company A and company B (default company A) - User2 in company A and company B (default company A) As user1 select company B in company switcher. -> You never see user2 as he's hidden by a record rule. This issue was present in older version when disabling the “Common Contact Book” feature, because it was then enabling the faulty record rule. Since [1], this faulty record rule is always enabled. (Note that res.partner record rules are applied to res.user through _inherits) We chose to remove the faulty record rules so that the present usecase is now working, but the drawback is that you now see partners from other companies. Also remove [2] that try to fix the issue and become useless if the rule is removed. [1] commit 25714692b23624d04a43862db26ebcf802b89399 [2] commit d6c65aa4d48ae2bf10830e04a3fb043b06816277 closes odoo/odoo#37712 Signed-off-by: Arnold Moyaux --- odoo/addons/base/security/base_security.xml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/odoo/addons/base/security/base_security.xml b/odoo/addons/base/security/base_security.xml index 2d1e5289ce7..e9288666e57 100644 --- a/odoo/addons/base/security/base_security.xml +++ b/odoo/addons/base/security/base_security.xml @@ -12,12 +12,6 @@ - - res.partner company - - ['|', '|', ('id', '=', user.partner_id.id), ('company_id', 'in', company_ids), ('company_id', '=', False)] - - res_partner: portal/public: read access on my commercial partner @@ -167,7 +161,7 @@ user rule - ['|', ('id', '=', user.id), ('company_ids', 'in', company_ids)] + [('company_ids', 'in', company_ids)]