[18.0][FIX] mail_activity_team: remaining calls to previous refactored get_default_team_id method#168
Closed
StefanRijnhart wants to merge 1 commit intoOCA:18.0from
Conversation
…default_team method Regression of OCA#149 Fixes ``` File "/mnt/data/odoo-addons-dir/mail_activity_team/wizard/mail_activity_schedule.py", line 53, in _onchange_activity_team_user_id and self.activity_team_user_id in self.activity_team_id.member_ids File "/opt/odoo/odoo/fields.py", line 3113, in __get__ return super().__get__(records, owner) File "/opt/odoo/odoo/fields.py", line 1244, in __get__ self.recompute(record) File "/opt/odoo/odoo/fields.py", line 1471, in recompute apply_except_missing(self.compute_value, recs) File "/opt/odoo/odoo/fields.py", line 1444, in apply_except_missing func(records) File "/opt/odoo/odoo/fields.py", line 1493, in compute_value records._compute_field_value(self) File "/opt/odoo/odoo/models.py", line 5302, in _compute_field_value fields.determine(field.compute, self) File "/opt/odoo/odoo/fields.py", line 110, in determine return needle(*args) File "/mnt/data/odoo-addons-dir/mail_activity_team/wizard/mail_activity_schedule.py", line 30, in _compute_activity_team_id ]._get_default_team_id( TypeError: MailActivity._get_default_team_id() takes 1 positional argument but 3 were given ```
CRogos
reviewed
Mar 31, 2026
Comment on lines
+37
to
+43
| activity = self.env["mail.activity"].new( | ||
| values={ | ||
| "res_model_id": wizard.sudo().res_model_id.id, | ||
| "user_id": wizard.activity_user_id.id, | ||
| }, | ||
| ) | ||
| wizard.activity_team_id = activity._get_default_team_id() |
Contributor
There was a problem hiding this comment.
I am not convinced that this is a better pattern than adding parameters to the method?
Before activity_team_user_id was used instead of activity_user_id. Is this intendet?
Member
Author
There was a problem hiding this comment.
It shouldn't matter whether to use activity_user_id or activity_team_user_id. I believe the dedicated team user fields are only introduced to apply the domain on team membership, but fundamentally the fields are related and kept in sync by Odoo.
What you can do is take the additional test coverage of this PR and copy it into your branch so that we can see how it looks on your PR.
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.
Regression of #149
Fixes