[17.0][FIX] mail_activity_board: fix computing related_model_instance#1875
Open
astirpe wants to merge 1 commit into
Open
[17.0][FIX] mail_activity_board: fix computing related_model_instance#1875astirpe wants to merge 1 commit into
astirpe wants to merge 1 commit into
Conversation
baf067f to
f231ba4
Compare
hbrunn
requested changes
Jun 22, 2026
| ) | ||
| if has_access: | ||
| ref = f"{record.res_model},{record.res_id}" | ||
| record.related_model_instance = ref |
Member
There was a problem hiding this comment.
can't we catch an access error here instead?
Member
Author
There was a problem hiding this comment.
Yes indeed, I rewrote it, could you check again?
… for restricted access
f231ba4 to
da4d523
Compare
hbrunn
reviewed
Jun 26, 2026
Comment on lines
+33
to
+35
| record.related_model_instance = ( | ||
| f"{record.res_model},{record.res_id}" | ||
| ) |
Member
There was a problem hiding this comment.
shouldn't it be enough to wrap this?
Member
Author
There was a problem hiding this comment.
It's not enough, it would reintroduce the crash we are trying to fix.
The original crash didn't occur during the compute method, which didn't fail itself. The crash would simply happen a moment later: when the web client tries to render the view, it attempts to fetch the target record's display name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: Loading the chatter crashes with a ValueError if a user lacks read access to an activity's related model. This happens because Odoo's ORM strictly validates assignments to Reference fields and rejects the restricted model.
Fix: Added a check inside _compute_related_model_instance. If the user cannot read the target model, the field safely defaults to False instead of crashing the entire view.