-
-
Notifications
You must be signed in to change notification settings - Fork 538
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
[15.0][FIX] base_substate: track template on substate #735
base: 15.0
Are you sure you want to change the base?
[15.0][FIX] base_substate: track template on substate #735
Conversation
I can confirm the issue. Test on this one are failling. |
35062f4
to
e3863e4
Compare
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.
See comments in: #736 (review)
6fe65b2
to
8fc2c69
Compare
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. |
Just tested this locally. The error still exsists.
|
899633b
to
2205a6f
Compare
@bosd Thank you for checked. |
c774ecb
to
4df11b6
Compare
4df11b6
to
29ba690
Compare
@Saran440 Can you please force push again. To see if tests pass this time? |
8b43ff5
to
12822c5
Compare
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.
LGTM 💯
@oca/server-ux-maintainers Can we get a merge here? |
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.
The issue seems to be that _track_template of the mixin is bypassed in the ORM inheritance MRO. The solution put forward earlier today in https://github.com/OCA/sale-workflow/pull/3483/files is to change the inheritance order.
The solution in this PR is to refactor out the method.
I would like the solutions to converge, but I don't know which approach is better. Do you have any arguments for either? @Saran440 @bosd @len-foss
Well, you could argue "my" solution is a bit more finicky because you need to make sure that inherits are in the right order, but this is something that is true in all the rest of Odoo's ORM (and arguably all of OOP). But I think the reason this solution is worse is that this bypass the mail being sent in the post commit hook. This feature has been done to avoid a flow that would crash after it has sent an email (you can imagine the spam as the backend user will never see the message in DB). It's better to let mail.thread handle everything. |
So should we proceed with this one? |
I think the usage of the post commit hook is a strong argument. We can therefore go with @len-foss's solution or refactor the solution proposed here such that the outgoing mail is only triggered in the post commit hook. That is probably best of both worlds, but it requires additional development. |
Move function
_track_template()
on base_substate_mixin to mail_threadCurrently, Email Template on Base Substate is not working.
Step to error: