From 85d3f1af7ad76c8be4f519de3da4bcad2f86edfe Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 21 Feb 2017 10:57:55 +0100 Subject: [PATCH] [FIX] web_advanced_search_x2x: Several things * Make it good-looking * Update known issues * Fix templates. * Make other operators work again --- web_advanced_search/README.rst | 7 +++---- .../static/src/css/web_advanced_search_x2x.less | 16 ++++++++++++++++ .../static/src/js/web_advanced_search_x2x.js | 11 ++++------- web_advanced_search/views/templates.xml | 1 + 4 files changed, 24 insertions(+), 11 deletions(-) create mode 100644 web_advanced_search/static/src/css/web_advanced_search_x2x.less diff --git a/web_advanced_search/README.rst b/web_advanced_search/README.rst index be42ca3b..548ef398 100644 --- a/web_advanced_search/README.rst +++ b/web_advanced_search/README.rst @@ -37,10 +37,9 @@ Note that you can stack searching for properties: Simply add another advanced se Known issues / Roadmap ====================== -* When you use *is [not] equal to* search system and click on an option with - the mouse, the search dropdown gets hidden and you have to reopen it and - reapply the filter. As a workaround, use the keyboard to select the option - you want. +* When you use *is in selection* search system and choose a domain, it gets + immediately applied, so to add a new condition, you will have to use again + the *Filters* menu. Credits ======= diff --git a/web_advanced_search/static/src/css/web_advanced_search_x2x.less b/web_advanced_search/static/src/css/web_advanced_search_x2x.less new file mode 100644 index 00000000..008e4b56 --- /dev/null +++ b/web_advanced_search/static/src/css/web_advanced_search_x2x.less @@ -0,0 +1,16 @@ +.openerp { + .oe-search-options { + .searchview_extended_prop_value { + .oe_form { + .ui-autocomplete-input { + .form-control(); + } + + .oe_m2o_drop_down_button { + top: 6px; + right: 2px; + } + } + } + } +} diff --git a/web_advanced_search/static/src/js/web_advanced_search_x2x.js b/web_advanced_search/static/src/js/web_advanced_search_x2x.js index d77e740a..0684aa16 100644 --- a/web_advanced_search/static/src/js/web_advanced_search_x2x.js +++ b/web_advanced_search/static/src/js/web_advanced_search_x2x.js @@ -119,13 +119,8 @@ odoo.define('web_advanced_search_x2x.search_filters', function (require) { x2x_autocomplete_open: function() { var widget = this._x2x_field.$input.autocomplete("widget"); - widget.on('click', 'li', function(e) - { - widget.trigger( - 'menuselect', - {item: jQuery(e.currentTarget)} - ); - e.stopPropagation(); + widget.on('click', 'li', function(event) { + event.stopPropagation(); }); }, get_domain: function () { @@ -201,6 +196,8 @@ odoo.define('web_advanced_search_x2x.search_filters', function (require) { * @return {jQuery.Deferred} */ value_rerender: function () { + this.value._x2x_field && this.value._x2x_field.destroy(); + delete this.value._x2x_field; return this.value.appendTo( this.$(".searchview_extended_prop_value").show().empty() ); diff --git a/web_advanced_search/views/templates.xml b/web_advanced_search/views/templates.xml index 4dee899f..43eebace 100644 --- a/web_advanced_search/views/templates.xml +++ b/web_advanced_search/views/templates.xml @@ -5,6 +5,7 @@