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
[FIX] mail: access error for the id of another company #28692
Conversation
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 won't this cause issues? The e-mail template is in a |
@Yenthe666 I might be wrong but are you sure it is in a no-update data tag ? If I'm not wrong the related xml data tag is the one L40 |
@nim-odoo I reproduced the bug on v11 too but the odoo/addons/mail/data/mail_data.xml Line 114 in c70bdd0
|
Sorry you're right, I missed the second tag which does update. Sorry! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No error on company.name
?
Damn sorry nim, yersterday the fix was doing just fine, today I have plenty bugs more, including |
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:
another.
user" and created the third one.
user1: comp1
user2: comp2
user2: comp2
Project: multiple-company
Project/Task: multiple-company
so each user can access tasks created in other companies.
opw-1907844
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr