Merge pull request #764 from Tecnativa/10.0-web_advanced_search_x2x-fix_string_leafs

[FIX] web_advanced_search_x2x: Allow to combine multiple domains
pull/766/head
Pedro M. Baeza 2017-10-19 18:13:43 +02:00 committed by GitHub
commit 85d519d937
2 changed files with 10 additions and 6 deletions

View File

@ -5,7 +5,7 @@
{
"name": "Search x2x fields",
"version": "10.0.2.0.1",
"version": "10.0.2.0.2",
"author": "Therp BV, "
"Tecnativa, "
"Odoo Community Association (OCA)",

View File

@ -153,11 +153,15 @@ odoo.define('web_advanced_search_x2x.search_filters', function (require) {
var domain = new data.CompoundDomain(),
name = this.field.name;
$.map(value, function (el) {
domain.add([[
_.str.sprintf("%s.%s", name, el[0]),
el[1],
el[2],
]]);
var leaf = el;
if (typeof el !== "string") {
leaf = [
_.str.sprintf("%s.%s", name, el[0]),
el[1],
el[2],
];
}
domain.add([leaf]);
});
return domain;
} else {