From b3ddb46aab9b702be1daf5696d5e7d9bdee0948c Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Tue, 19 Dec 2023 09:51:39 +0100 Subject: [PATCH] [FIX] base_automation: correctly trigger on_change rules Before this commit, and since [1], automated rules of type "on_change" (i.e. on UI update) didn't run. This is because the wrong field (trigger_field_ids) was used to record fields for which the rule must be triggered. For that type of rule, the field to use is on_change_field_ids. As a consequence, those rules were not correctly created, and thus they didn't properly react to field changes. [1] odoo/odoo@8bdac7e26c961e04117149529a8c7eccd8cb734e opw 3632084 opw 3595411 closes odoo/odoo#146780 Signed-off-by: Lucas Perais (lpe) --- .../views/base_automation_views.xml | 7 ++++- .../static/tests/tour/base_automation_tour.js | 28 ++++++++++++++++++- .../test_base_automation/tests/test_tour.py | 16 +++++++++++ 3 files changed, 49 insertions(+), 2 deletions(-) diff --git a/addons/base_automation/views/base_automation_views.xml b/addons/base_automation/views/base_automation_views.xml index 89c38b58e5e..af6559a7be4 100644 --- a/addons/base_automation/views/base_automation_views.xml +++ b/addons/base_automation/views/base_automation_views.xml @@ -98,7 +98,12 @@ options="{'no_open': True, 'no_create': True}" domain="[('model_id', '=', model_id)]" context="{'hide_model': 1}" - invisible="trigger not in ['on_create_or_write', 'on_change']" widget="many2many_tags" /> + invisible="trigger != 'on_create_or_write'" widget="many2many_tags" /> +