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 Activity

Entity: fsm.order

Compute Method: _compute_order_activity_ids

Inputs Method Outputs
  • template_id
  • template_id.temp_activity_ids
for rec in self:
            # Clear existing activities
            if not rec.template_id:
                continue

            activity_list = [(5, 0, 0)]
            activity_list.extend(
                (
                    0,
                    0,
                    {
                        "name": temp_activity.name,
                        "required": temp_activity.required,
                        "ref": temp_activity.ref,
                        "state": temp_activity.state,
                    },
                )
                for temp_activity in rec.template_id.temp_activity_ids
            )

            rec.order_activity_ids = activity_list

Back to entity