Skip to content
Snippets Groups Projects
Commit 4f5b8c47 authored by Pratik Raval (PRRA)'s avatar Pratik Raval (PRRA)
Browse files

[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#135610

Related: odoo/enterprise#47453
Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
parent e00dce5e
No related branches found
No related tags found
No related merge requests found
......@@ -57,7 +57,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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment