def _compute_opportunities_overdue_data(self):
    opportunity_data = self.env['crm.lead'].read_group([('team_id', 'in', self.ids), ('probability', '<', 100), ('type', '=', 'opportunity'), ('date_deadline', '<', fields.Date.to_string(fields.Datetime.now()))], ['expected_revenue', 'team_id'], ['team_id'])
    counts = {datum['team_id'][0]: datum['team_id_count'] for datum in opportunity_data}
    amounts = {datum['team_id'][0]: datum['expected_revenue'] for datum in opportunity_data}
    for team in self:
        team.opportunities_overdue_count = counts.get(team.id, 0)
        team.opportunities_overdue_amount = amounts.get(team.id, 0)
def _compute_opportunities_overdue_data(self):
    opportunity_data = self.env['crm.lead'].read_group([('team_id', 'in', self.ids), ('probability', '<', 100), ('type', '=', 'opportunity'), ('date_deadline', '<', fields.Date.to_string(fields.Datetime.now()))], ['expected_revenue', 'team_id'], ['team_id'])
    counts = {datum['team_id'][0]: datum['team_id_count'] for datum in opportunity_data}
    amounts = {datum['team_id'][0]: datum['expected_revenue'] for datum in opportunity_data}
    for team in self:
        team.opportunities_overdue_count = counts.get(team.id, 0)
        team.opportunities_overdue_amount = amounts.get(team.id, 0)