mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[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-7870
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user