From 1f6a7debf2bf90fc293c7589cf52f08d42cf6249 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Wed, 16 Oct 2019 09:20:15 +0000 Subject: [PATCH] [FIX] web: custom filter on date[time] with changing the operator On a list view, Add a custom filter on a date Change the operator to "in between" Change it back to "equal" Apply the search Before this commit, the label of the filter still was in between Whereas it should have been "equal to ..." After this commit, the label of the filter is correct OPW 2085951 closes odoo/odoo#38705 closes odoo/odoo#38869 closes odoo/odoo#38936 Original-signed-off-by: Lucas Perais (lpe) Original-signed-off-by: Lucas Perais (lpe) X-original-commit: bb775152b79f1212258ff47daac387eaf11f64e2 Signed-off-by: Lucas Perais (lpe) --- .../static/src/js/views/control_panel/search/search_filters.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/views/control_panel/search/search_filters.js b/addons/web/static/src/js/views/control_panel/search/search_filters.js index 759626bc1bb..f6b4bc13f6b 100644 --- a/addons/web/static/src/js/views/control_panel/search/search_filters.js +++ b/addons/web/static/src/js/views/control_panel/search/search_filters.js @@ -237,7 +237,8 @@ var DateTime = Field.extend({ }, toString: function () { var str = field_utils.format[this.attributes.type](this.get_value(), {type: this.attributes.type}); - var date_1_value = this.datewidget_1 && this.get_value(1); + // the second datewidget might have been hidden because the operator has changed + var date_1_value = this.datewidget_1 && !this.datewidget_1.$el.hasClass('o_hidden') && this.get_value(1); if (date_1_value) { str += _lt(" and ") + field_utils.format[this.attributes.type](date_1_value, {type: this.attributes.type}); }