From 6ed7d952c411d2fbae18f869a93a68ce94cadd35 Mon Sep 17 00:00:00 2001 From: "Pratik Raval (PRRA)" Date: Thu, 14 Sep 2023 17:52:58 +0530 Subject: [PATCH] [FIX] marketing_automation: fix mailing_filter widget Before this commit: The `mailing_filter` widget used to take the 2nd occurrence of a many2one(selection) field and hide it in certain conditions, as it was assumed that it is the field having the widget. Thus when there is more than 1 occurrence of a many2one field in the form view (before the field with the widget), it used to hide random fields instead of targeted field. After this commit: The `mailing_filter` widget will only target the field with the widget, hence solving the issue at hand. Task-3430510 closes odoo/odoo#136094 X-original-commit: 4f5b8c47be4077cdaf7837062f518b7aef529d71 Related: odoo/enterprise#47678 Signed-off-by: Thibault Delavallee (tde) --- addons/mass_mailing/static/src/js/mailing_m2o_filter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mass_mailing/static/src/js/mailing_m2o_filter.js b/addons/mass_mailing/static/src/js/mailing_m2o_filter.js index a93d63bd2ed..a5b82c96c34 100644 --- a/addons/mass_mailing/static/src/js/mailing_m2o_filter.js +++ b/addons/mass_mailing/static/src/js/mailing_m2o_filter.js @@ -58,7 +58,7 @@ export class FieldMany2OneMailingFilter extends Many2OneField { return; } const filterCount = this.props.record.data.mailing_filter_count; - const dropdown = document.querySelectorAll('.o_field_many2one_selection > .o_input_dropdown')[1] + const dropdown = document.querySelector('.o_field_mailing_filter > .o_field_many2one_selection > .o_input_dropdown') if (dropdown) { dropdown.classList.toggle('d-none', !filterCount); }