forked from Techsystech/web
[FIX] web_advanced_search: display label name in partners search
Without this patch, when searching in the `res.partner` view for 'Tags is equal to "Something"', the search bar would display "Tags is equal to "123"' (the tag ID instead of its display name). @moduon MT-787016.0
parent
7c2a4eaef6
commit
04c99b9044
|
@ -15,19 +15,21 @@ patch(CustomFilterItem.prototype, "web_advanced_search.CustomFilterItem", {
|
|||
this._super.apply(this, arguments);
|
||||
this.OPERATORS.relational = this.OPERATORS.char;
|
||||
this.FIELD_TYPES.many2one = "relational";
|
||||
this.FIELD_TYPES.many2many = "relational";
|
||||
this.FIELD_TYPES.one2many = "relational";
|
||||
},
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
setDefaultValue(condition) {
|
||||
const res = this._super.apply(this, arguments);
|
||||
const fieldType = this.fields[condition.field].type;
|
||||
const genericType = this.FIELD_TYPES[fieldType];
|
||||
if (genericType === "relational") {
|
||||
condition.value = 0;
|
||||
condition.displayedValue = "";
|
||||
return;
|
||||
}
|
||||
return res;
|
||||
return this._super.apply(this, arguments);
|
||||
},
|
||||
/**
|
||||
* Add displayed value to preFilters for "relational" types.
|
||||
|
|
Loading…
Reference in New Issue