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.plan.template

Compute Method: _compute_activity_team_user_id

View 19.0
Inputs Method Outputs
  • activity_team_user_id
  • activity_team_required
  • activity_team_id
+ """Ensure consistency between the activity team and the team user"""
+ for template in self:
+             user = template.activity_team_user_id
+             if template.activity_team_required:
+                 team = template.activity_team_id
+                 if team:
+                     if not user or user not in team.member_ids:
+                         if team.user_id:
+                             template.activity_team_user_id = team.user_id
+                         elif len(team.member_ids) == 1:
+                             template.activity_team_user_id = team.member_ids
+                         elif user:
+                             template.activity_team_user_id = False
+                 elif user:
+                     template.activity_team_user_id = False
+             elif user:
+                 template.activity_team_user_id = False
  • activity_team_user_id

Back to entity