|
@ -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, |
|
|