-
-
Notifications
You must be signed in to change notification settings - Fork 289
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
[14.0][FIX] mail_template_multi_company: Don't set default company on mail template #485
[14.0][FIX] mail_template_multi_company: Don't set default company on mail template #485
Conversation
…template Before this commit, this caused a bug that can be summarised as follows: 1. User A installs mail_template_multi_company. 2. User A installs another module, say, sale. 3. User A creates a new company and sets User B as a member of this (and only this) company. 4. User B tries to send an invoice. An error occurs at step 4 because of a bug at step 2. At step 2, when the sale module was installed, its mail template (which is used by all companies) defaulted to self.env.company, which was base.main_company. At step 4, using the mail template is forbidden for User B, because the template belongs to a company of which they are not a member. Removing the default value prevents this problem. Signed-off-by: Carmen Bianca BAKKER <[email protected]>
Hi @Olivier-LAURENT, |
@DaniilDigtyar ping :) |
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.
Code review LGTM
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
Hi @Olivier-LAURENT, |
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.
Thanks! The default company causes misery when testing mail template functionality in unrelated modules.
/ocabot merge patch |
On my way to merge this fine PR! |
Congratulations, your PR was merged at 443fd82. Thanks a lot for contributing to OCA. ❤️ |
Fixes #483
Before this commit, this caused a bug that can be summarised as follows:
An error occurs at step 4 because of a bug at step 2. At step 2, when the sale module was installed, its mail template (which is used by all companies) defaulted to self.env.company, which was base.main_company. At step 4, using the mail template is forbidden for User B, because the template belongs to a company of which they are not a member.
Removing the default value prevents this problem.