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

Module: POS - Sales

Entity: crm.team

Compute Method: _compute_pos_order_amount_total

View 18.0
Inputs Method Outputs
  • pos_config_ids
- data = self.env['report.pos.order']._read_group([
-             ('session_id.state', '=', 'opened'),
-             ('config_id.crm_team_id', 'in', self.ids),
-         ], ['config_id'], ['price_total:sum'])
- rg_results = {config.id: price_total_sum for config, price_total_sum in data}
- for team in self:
-             team.pos_order_amount_total = sum([
-                 rg_results.get(config.id, 0.0)
-                 for config in team.pos_config_ids
-             ])
  • pos_order_amount_total

Back to entity