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_trg_field_ref

View 17.0 View 20.0
Inputs Method Outputs
  • trigger_field_ids
  • trigger_field_ids.relation
- to_reset = self.filtered(lambda a: a.trigger not in ['on_stage_set', 'on_tag_set'] or len(a.trigger_field_ids) != 1)
- to_reset.trg_field_ref = False
- for automation in (self - to_reset):
-             relation = automation.trigger_field_ids.relation
-             automation.trg_field_ref_model_name = relation
-             # always re-assign to an empty value to make sure we have no discrepencies
-             automation.trg_field_ref = self.env[relation]
+ self.trg_field_ref = False
  • trg_field_ref_model_name
  • trg_field_ref

Back to entity