Merge pull request #1152 from Tecnativa/11.0-web_advanced_search-fix_x2many

[FIX] web_advanced_search: Ignore field domain
This commit is contained in:
Pedro M. Baeza
2019-01-14 12:45:38 +01:00
committed by GitHub

View File

@@ -179,7 +179,14 @@ odoo.define("web_advanced_search", function (require) {
},
};
// See https://stackoverflow.com/a/11508530/1468388
params.fields[this.field.name] = _.omit(this.field, "onChange");
// to know how to include this in the previous step in ES6
params.fields[this.field.name] = _.omit(
this.field,
// User needs all records, to actually produce a new domain
"domain",
// Onchanges make no sense in this context, there's no record
"onChange"
);
if (this.field.type.endsWith("2many")) {
// X2many fields behave like m2o in the search context
params.fields[this.field.name].type = "many2one";