forked from Techsystech/web
[IMP] - Use super to get default case
parent
6fd4995ebb
commit
ce91dd0137
|
@ -7,6 +7,7 @@
|
|||
"name": "Wildcard in advanced search",
|
||||
"summary": "Webmodule to add wildcard operators in advanced search field",
|
||||
"version": "12.0.1.0.0",
|
||||
"website": "https://github.com/OCA/web",
|
||||
"category": "web",
|
||||
"license": "AGPL-3",
|
||||
"author": "initOS GmbH & Co. KG, Therp BV, "
|
||||
|
|
|
@ -15,14 +15,13 @@ odoo.define('web_advanced_search_wildcard', function (require) {
|
|||
|
||||
Char.include({
|
||||
get_domain: function (field, operator) {
|
||||
var res = this._super(field, operator);
|
||||
switch (operator.value) {
|
||||
case '∃': return [[field.name, '!=', false]];
|
||||
case '∄': return [[field.name, '=', false]];
|
||||
case '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 '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