Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Mail Activity Team

Entity: mail.activity

Compute Method: _compute_team_id

Inputs Method Outputs
"""Assign team if no team yet or team is incompatible"""
for activity in self:
            if (
                not activity.team_id
                or activity.user_id
                and activity.user_id not in activity.team_id.member_ids
                or (
                    activity.res_model_id
                    and activity.team_id.res_model_ids
                    and activity.res_model_id not in activity.team_id.res_model_ids
                )
            ):
                activity.team_id = activity._get_default_team_id(
                    activity.user_id.id, activity.res_model_id.id
                )

Back to entity