Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] mail: access error for the id of another company #28692

Commits on Nov 14, 2018

  1. [FIX] mail: access error for the id of another company

    When creating a mail for a user in an other company then the
    record, the "send" button fails with a traceback because on
    specific template try to access the company.id of the user
    which is not accessible due to the access controle.
    
    This PR fixes the problem by sudoing the access to the company id
    in the template. The mail now sends without problem.
    
    Step to reproduce:
    
    1) Use two company (comp1 and comp2), I used YourCompany and created
       another.
    2) Use 3 users (user1, user2, user3), I used "Mitchel Admin", "Demo
       user" and created the third one.
    3) Change the users to set both company as allowed.
    4) Set the current company of the users as follow:
       user1: comp1
       user2: comp2
       user2: comp2
    5) Install the project module
    6) In settings > security > record rules, delete the records named
       - `Project: multiple-company`
       - `Project/Task: multiple-company`
       so each user can access tasks created in other companies.
    7) Using user1, create a new project and a new task.
    8) Using user2, go to the created task and add user3 as follower.
    9) Send the mail => traceback.
    
    opw-1907844
    Julien00859 committed Nov 14, 2018
    Configuration menu
    Copy the full SHA
    e209400 View commit details
    Browse the repository at this point in the history