25 lines
1.4 KiB
Diff
25 lines
1.4 KiB
Diff
diff --git a/addons/web/static/src/search/filter_menu/custom_filter_item.js b/addons/web/static/src/search/filter_menu/custom_filter_item.js
|
|
index f67f5fb40af..22525b7cbfd 100644
|
|
--- a/addons/web/static/src/search/filter_menu/custom_filter_item.js
|
|
+++ b/addons/web/static/src/search/filter_menu/custom_filter_item.js
|
|
@@ -46,6 +46,8 @@ const FIELD_OPERATORS = {
|
|
char: [
|
|
{ symbol: "ilike", description: _lt("contains") },
|
|
{ symbol: "not ilike", description: _lt("doesn't contain") },
|
|
+ { symbol: "startswith", description: _lt("starts with") },
|
|
+ { symbol: "endswith", description: _lt("ends with") },
|
|
{ symbol: "=", description: _lt("is equal to") },
|
|
{ symbol: "!=", description: _lt("is not equal to") },
|
|
{ symbol: "!=", description: _lt("is set"), value: false },
|
|
@@ -257,6 +259,10 @@ export class CustomFilterItem extends Component {
|
|
[field.name, ">=", domainValue[0]],
|
|
[field.name, "<=", domainValue[1]]
|
|
);
|
|
+ } else if (operator.symbol === "startswith") {
|
|
+ domainArray.push([field.name, '=ilike', domainValue[0] + '%']);
|
|
+ } else if (operator.symbol === "endswith") {
|
|
+ domainArray.push([field.name, '=ilike', '%' + domainValue[0]]);
|
|
} else {
|
|
domainArray.push([field.name, operator.symbol, domainValue[0]]);
|
|
}
|