diff options
| author | Nans Lefebvre <len@odoo.com> | 2019-05-27 11:30:39 +0000 |
|---|---|---|
| committer | Nans Lefebvre <len@odoo.com> | 2019-05-27 11:32:56 +0000 |
| commit | a98c15f44358d6342632a8bd461fb476461f35ae (patch) | |
| tree | 3921bad7d64cac778dc04cfd52139062f6b01d4c /addons/web/static/tests/fields/basic_fields_tests.js | |
| parent | 0ac7635b54c5c596ab3609560315521df8f81fa4 (diff) | |
[FIX] mail: fix multi-company access rights check when creating activities
When checking the rights when creating a new activity, c38a0d67680
made the choice to bypass the check if the multi-company case.
However the "multi-company case" was determined by checking that
len(target_user.company_ids) > 1; however if target_user.company_ids contains
companies to which the current user doesn't have access, then this is wrong.
Let the active user be Ua in companies C1, C2, currently in C1,
and the target user be Ut in C2, C3, currently in C3.
Then target_user.company_ids == [C2] for Ua, so the check would be False.
This shows that we need len(target_user.sudo().company_ids) > 1.
opw 1998709
closes odoo/odoo#33681
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Diffstat (limited to 'addons/web/static/tests/fields/basic_fields_tests.js')
0 files changed, 0 insertions, 0 deletions
