From ae32bfea53cf36afcf8c86279de16c1c42dded60 Mon Sep 17 00:00:00 2001 From: "Nasreddin Boulif (bon)" Date: Thu, 2 Feb 2023 02:29:16 +0000 Subject: [PATCH] [FIX] web: update domain (selector) when '(not) in' operator used MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to reproduce: - Install mass_mailing module (for test purpose) - Create a new mailing and change `Recipients` to `contact` - Add a new node in the domain (by clicking on +) and set : Field => `Zip`, Operator => `in`, Value => `123` - click on + next to value Issue: Domain is not updated (same issue with `not in`). Cause: When adding a new value to the domain, a div is added with the value and a cross button (to remove the value from domain). The button have a `t-on-click` attribute that call a function (removeTag(tag_index)) and therefore as soon as the div is added, the function is called. Solution: Use `() => func(arg)` syntax instead to be able to call the function with arguments only when button is clicked. opw-3099583 closes odoo/odoo#111714 X-original-commit: f9a9f2da88a68040642231db2489e134d1f8096a Signed-off-by: Michaƫl Mattiello Signed-off-by: Nasreddin Boulif (bon) --- .../fields/domain_selector_field_input_with_tags.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/core/domain_selector/fields/domain_selector_field_input_with_tags.xml b/addons/web/static/src/core/domain_selector/fields/domain_selector_field_input_with_tags.xml index 5d4f6c3d706..298808a155d 100644 --- a/addons/web/static/src/core/domain_selector/fields/domain_selector_field_input_with_tags.xml +++ b/addons/web/static/src/core/domain_selector/fields/domain_selector_field_input_with_tags.xml @@ -11,7 +11,7 @@ role="img" aria-label="Remove tag" title="Remove tag" - t-on-click="removeTag(tag_index)" + t-on-click="() => this.removeTag(tag_index)" />