mirror of https://github.com/OCA/web.git
[IMP] - Use super to get default case
parent
6fd4995ebb
commit
ce91dd0137
|
@ -7,6 +7,7 @@
|
||||||
"name": "Wildcard in advanced search",
|
"name": "Wildcard in advanced search",
|
||||||
"summary": "Webmodule to add wildcard operators in advanced search field",
|
"summary": "Webmodule to add wildcard operators in advanced search field",
|
||||||
"version": "12.0.1.0.0",
|
"version": "12.0.1.0.0",
|
||||||
|
"website": "https://github.com/OCA/web",
|
||||||
"category": "web",
|
"category": "web",
|
||||||
"license": "AGPL-3",
|
"license": "AGPL-3",
|
||||||
"author": "initOS GmbH & Co. KG, Therp BV, "
|
"author": "initOS GmbH & Co. KG, Therp BV, "
|
||||||
|
|
|
@ -15,14 +15,13 @@ odoo.define('web_advanced_search_wildcard', function (require) {
|
||||||
|
|
||||||
Char.include({
|
Char.include({
|
||||||
get_domain: function (field, operator) {
|
get_domain: function (field, operator) {
|
||||||
|
var res = this._super(field, operator);
|
||||||
switch (operator.value) {
|
switch (operator.value) {
|
||||||
case '∃': return [[field.name, '!=', false]];
|
|
||||||
case '∄': return [[field.name, '=', false]];
|
|
||||||
case 'startswith': return [[field.name, '=ilike', this.get_value() + '%']];
|
case 'startswith': return [[field.name, '=ilike', this.get_value() + '%']];
|
||||||
case 'not_startswith': return ['!', [field.name, '=ilike', this.get_value() + '%']];
|
case 'not_startswith': return ['!', [field.name, '=ilike', this.get_value() + '%']];
|
||||||
case 'endswith': return [[field.name, '=ilike', '%' + this.get_value()]];
|
case 'endswith': return [[field.name, '=ilike', '%' + this.get_value()]];
|
||||||
case 'not_endswith': return ['!', [field.name, '=ilike', '%' + this.get_value()]];
|
case 'not_endswith': return ['!', [field.name, '=ilike', '%' + this.get_value()]];
|
||||||
default: return [[field.name, operator.value, this.get_value()]];
|
default: return res;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue