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: crm.team

Compute Method: _compute_sales_to_invoice

Inputs Method Outputs
  • id
sale_order_data = self.env['sale.order']._read_group([
            ('team_id', 'in', self.ids),
            ('invoice_status','=','to invoice'),
        ], ['team_id'], ['__count'])
data_map = {team.id: count for team, count in sale_order_data}
for team in self:
            team.sales_to_invoice_count = data_map.get(team.id,0.0)

Back to entity