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: account.move

Compute Method: _compute_team_id

Inputs Method Outputs
sale_moves = self.filtered(lambda move: move.is_sale_document(include_receipts=True))
for ((user_id, company_id, partner_team_id), moves) in groupby(
            sale_moves,
            key=lambda m: (m.invoice_user_id.id, m.company_id.id, m.partner_id.team_id.id)
        ):
            default_team_id = self.env.context.get('default_team_id', False) or partner_team_id
            self.env['account.move'].concat(*moves).team_id = self.env['crm.team'].with_context(
                allowed_company_ids=[company_id],
                default_team_id=default_team_id
            )._get_default_team_id(
                user_id=user_id,
            )

Back to entity