mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[IMP] - Use super to get default case
This commit is contained in:
@@ -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;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user