Browse Source

[FIX] don't close advanced search prematurely; display fixes

pull/148/merge
Holger Brunn 7 years ago
committed by Pedro M. Baeza
parent
commit
f175987c4a
  1. 1
      web_advanced_search_x2x/__openerp__.py
  2. 1
      web_advanced_search_x2x/static/src/css/web_advanced_search_x2x.css
  3. 14
      web_advanced_search_x2x/static/src/js/web_advanced_search_x2x.js

1
web_advanced_search_x2x/__openerp__.py

@ -27,6 +27,7 @@ domain popups.
"summary": "Use a search widget in advanced search for x2x fields", "summary": "Use a search widget in advanced search for x2x fields",
"depends": [ "depends": [
'web', 'web',
'web_m2x_options',
], ],
"qweb": [ "qweb": [
'static/src/xml/web_advanced_search_x2x.xml', 'static/src/xml/web_advanced_search_x2x.xml',

1
web_advanced_search_x2x/static/src/css/web_advanced_search_x2x.css

@ -1,5 +1,6 @@
.openerp .searchview_extended_prop_value .oe_form_field_with_button .openerp .searchview_extended_prop_value .oe_form_field_with_button
{ {
display: inline-block;
position: relative; position: relative;
} }
.openerp .oe_searchview_drawer .web_advanced_search_x2x_domain .openerp .oe_searchview_drawer .web_advanced_search_x2x_domain

14
web_advanced_search_x2x/static/src/js/web_advanced_search_x2x.js

@ -47,7 +47,9 @@ openerp.web_advanced_search_x2x = function(instance)
return { return {
attrs: { attrs: {
name: this.field.name, name: this.field.name,
options: '{"no_create": true}',
options:
'{"create": false, "create_edit": false, ' +
'"no_open": true}',
}, },
} }
}, },
@ -59,6 +61,7 @@ openerp.web_advanced_search_x2x = function(instance)
} }
this.searchfield = new instance.web.form.FieldMany2One( this.searchfield = new instance.web.form.FieldMany2One(
this, this.create_searchfield_node()); this, this.create_searchfield_node());
this.searchfield.view = this;
return this.searchfield; return this.searchfield;
}, },
operator_changed: function(e) operator_changed: function(e)
@ -71,6 +74,9 @@ openerp.web_advanced_search_x2x = function(instance)
if(this.show_searchfield()) if(this.show_searchfield())
{ {
this.create_searchfield().appendTo(this.$el.empty()); this.create_searchfield().appendTo(this.$el.empty());
this.searchfield.$input.autocomplete('widget').on(
'click', this, function(e) { e.stopPropagation() }
);
} }
if(this.show_domain_selection()) if(this.show_domain_selection())
{ {
@ -209,8 +215,9 @@ openerp.web_advanced_search_x2x = function(instance)
.prop('disabled', self.searchview.build_search_data().domains.length == 0); .prop('disabled', self.searchview.build_search_data().domains.length == 0);
self.$buttonpane.find(".oe_selectcreatepopup-search-select") self.$buttonpane.find(".oe_selectcreatepopup-search-select")
.unbind('click') .unbind('click')
.click(function()
.click(function(e)
{ {
e.stopPropagation();
self.select_elements(self.selected_ids) self.select_elements(self.selected_ids)
.then(function() .then(function()
{ {
@ -228,10 +235,11 @@ openerp.web_advanced_search_x2x = function(instance)
}); });
}); });
}, },
select_domain: function()
select_domain: function(e)
{ {
var self = this, var self = this,
search = this.searchview.build_search_data(); search = this.searchview.build_search_data();
e.stopPropagation();
instance.web.pyeval.eval_domains_and_contexts({ instance.web.pyeval.eval_domains_and_contexts({
domains: search.domains, domains: search.domains,
contexts: search.contexts, contexts: search.contexts,

Loading…
Cancel
Save