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

Module: Field Service Recurring Work Orders

Entity: fsm.team

Compute Method: _compute_recurring_draft_count

Inputs Method Outputs
  • id
order_data = self.env["fsm.recurring"].read_group(
            [
                ("team_id", "in", self.ids),
                ("state", "=", "draft"),
            ],
            ["team_id"],
            ["team_id"],
        )
result = {data["team_id"][0]: int(data["team_id_count"]) for data in order_data}
for team in self:
            team.recurring_draft_count = result.get(team.id, 0)

Back to entity