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

Module: Automation Rules

Entity: base.automation

Compute Method: _compute_action_server_ids

Inputs Method Outputs
""" When changing / setting model, remove actions that are not targeting
        the same model anymore. """
for rule in self.filtered('model_id'):
            actions_to_remove = rule.action_server_ids.filtered(
                lambda action: action.model_id != rule.model_id
            )
            if actions_to_remove:
                rule.action_server_ids = [(3, action.id) for action in actions_to_remove]

Back to entity