[IMP] - Use super to get default case

pull/1326/head
sbejaoui 2019-07-22 10:10:50 +02:00
parent 6fd4995ebb
commit ce91dd0137
2 changed files with 3 additions and 3 deletions

View File

@ -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, "

View File

@ -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;
} }
}, },
}); });