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

Module: Sales

Entity: sale.order

Compute Method: _compute_team_id

View 19.0 View 20.0
Inputs Method Outputs
  • user_id
  • user_id.id
  • company_id
  • company_id.id
cached_teams = {}
for order in self:
            default_team_id = order._default_team_id()
            user_id = order.user_id.id
            company_id = order.company_id.id
            key = (default_team_id, user_id, company_id)
            if key not in cached_teams:
-                 cached_teams[key] = self.env['crm.team'].with_context(
-                     default_team_id=default_team_id,
-                 )._get_default_team_id(
-                     user_id=user_id,
-                     domain=self.env['crm.team']._check_company_domain(company_id),
+                 cached_teams[key] = (
+                     self
+                     .env["crm.team"]
+                     .with_context(default_team_id=default_team_id)
+                     ._get_default_team_id(
+                         user_id=user_id,
+                         domain=self.env["crm.team"]._check_company_domain(company_id),
+                     )
                )
            order.team_id = cached_teams[key]
  • team_id

Back to entity