|
@ -53,6 +53,10 @@ odoo.define('web_advanced_search_x2x.search_filters', function (require) { |
|
|
this._super.apply(this, arguments); |
|
|
this._super.apply(this, arguments); |
|
|
if (this.relational) { |
|
|
if (this.relational) { |
|
|
this.x2x_field().appendTo(this.$el); |
|
|
this.x2x_field().appendTo(this.$el); |
|
|
|
|
|
this._x2x_field.$el.on( |
|
|
|
|
|
"autocompleteopen", |
|
|
|
|
|
this.proxy('x2x_autocomplete_open') |
|
|
|
|
|
); |
|
|
} |
|
|
} |
|
|
delete this.relational; |
|
|
delete this.relational; |
|
|
}, |
|
|
}, |
|
@ -85,6 +89,7 @@ odoo.define('web_advanced_search_x2x.search_filters', function (require) { |
|
|
name: this.field.name, |
|
|
name: this.field.name, |
|
|
options: JSON.stringify({ |
|
|
options: JSON.stringify({ |
|
|
no_create: true, |
|
|
no_create: true, |
|
|
|
|
|
no_open: true, |
|
|
model: this.field.relation, |
|
|
model: this.field.relation, |
|
|
}), |
|
|
}), |
|
|
}, |
|
|
}, |
|
@ -111,6 +116,18 @@ odoo.define('web_advanced_search_x2x.search_filters', function (require) { |
|
|
return "char_domain"; |
|
|
return "char_domain"; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
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(); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
get_domain: function () { |
|
|
get_domain: function () { |
|
|
// Special way to get domain if user chose "domain" filter
|
|
|
// Special way to get domain if user chose "domain" filter
|
|
|
if (this.get_operator() == "domain") { |
|
|
if (this.get_operator() == "domain") { |
|
@ -227,10 +244,10 @@ odoo.define('web_advanced_search_x2x.search_filters', function (require) { |
|
|
_.each(compound_domains, function(domain) |
|
|
_.each(compound_domains, function(domain) |
|
|
{ |
|
|
{ |
|
|
combined.add(domain.eval()); |
|
|
combined.add(domain.eval()); |
|
|
}) |
|
|
|
|
|
|
|
|
}); |
|
|
_.each(leaves, function(leaf) |
|
|
_.each(leaves, function(leaf) |
|
|
{ |
|
|
{ |
|
|
combined.add([leaf]) |
|
|
|
|
|
|
|
|
combined.add([leaf]); |
|
|
}); |
|
|
}); |
|
|
result.domains[index] = combined; |
|
|
result.domains[index] = combined; |
|
|
} |
|
|
} |
|
|