Skip to content

Commit

Permalink
Merge PR #2983 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by yajo
  • Loading branch information
OCA-git-bot committed Nov 8, 2024
2 parents f3f4f15 + 04c99b9 commit d33bfc5
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d33bfc5

Please sign in to comment.