forked from Techsystech/web
[ADD] - Add doesn't start/end with options
parent
74616f771e
commit
6fd4995ebb
|
@ -25,11 +25,13 @@ Wildcard in advanced search
|
|||
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
|
||||
This module adds 3 options to advanced search of char, many2one,
|
||||
This module adds new options to advanced search of char, many2one,
|
||||
many2many and one2many fields:
|
||||
|
||||
* *starts with* (uses the domain *=ilike %<search string>*),
|
||||
* *doesn't start with* (uses the domain *not ilike %<search string>*),
|
||||
* *ends with* (uses the domain *=ilike <search string>%*),
|
||||
* *doesn't end with* (uses the domain *not ilike <search string>%*),
|
||||
* *matches* (uses the domain *=ilike <search string>*).
|
||||
|
||||
|
||||
|
@ -79,7 +81,7 @@ Contributors
|
|||
* L Freeke <lfreeke@therp.nl>
|
||||
* Alex Comba <alex.comba@agilebg.com>
|
||||
* Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
|
||||
* Souheil Bejaoui <souheil.bejaoui@acsone.eu>
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
|
|
@ -3,4 +3,4 @@
|
|||
* L Freeke <lfreeke@therp.nl>
|
||||
* Alex Comba <alex.comba@agilebg.com>
|
||||
* Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
|
||||
* Souheil Bejaoui <souheil.bejaoui@acsone.eu>
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
This module adds 3 options to advanced search of char, many2one,
|
||||
This module adds new options to advanced search of char, many2one,
|
||||
many2many and one2many fields:
|
||||
|
||||
* *starts with* (uses the domain *=ilike %<search string>*),
|
||||
* *doesn't start with* (uses the domain *not ilike %<search string>*),
|
||||
* *ends with* (uses the domain *=ilike <search string>%*),
|
||||
* *doesn't end with* (uses the domain *not ilike <search string>%*),
|
||||
* *matches* (uses the domain *=ilike <search string>*).
|
||||
|
||||
|
|
|
@ -368,11 +368,13 @@ ul.auto-toc {
|
|||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/web/tree/12.0/web_advanced_search_wildcard"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_advanced_search_wildcard"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/162/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p>This module adds 3 options to advanced search of char, many2one,
|
||||
<p>This module adds new options to advanced search of char, many2one,
|
||||
many2many and one2many fields:</p>
|
||||
<ul class="simple">
|
||||
<li><em>starts with</em> (uses the domain <em>=ilike %<search string></em>),</li>
|
||||
<li><em>doesn’t start with</em> (uses the domain <em>not ilike %<search string></em>),</li>
|
||||
<li><em>ends with</em> (uses the domain <em>=ilike <search string>%</em>),</li>
|
||||
<li><em>doesn’t end with</em> (uses the domain <em>not ilike <search string>%</em>),</li>
|
||||
<li><em>matches</em> (uses the domain <em>=ilike <search string></em>).</li>
|
||||
</ul>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
|
@ -421,6 +423,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
|||
<li>L Freeke <<a class="reference external" href="mailto:lfreeke@therp.nl">lfreeke@therp.nl</a>></li>
|
||||
<li>Alex Comba <<a class="reference external" href="mailto:alex.comba@agilebg.com">alex.comba@agilebg.com</a>></li>
|
||||
<li>Alexis de Lattre <<a class="reference external" href="mailto:alexis.delattre@akretion.com">alexis.delattre@akretion.com</a>></li>
|
||||
<li>Souheil Bejaoui <<a class="reference external" href="mailto:souheil.bejaoui@acsone.eu">souheil.bejaoui@acsone.eu</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
|
|
|
@ -7,7 +7,9 @@ odoo.define('web_advanced_search_wildcard', function (require) {
|
|||
|
||||
Char.prototype.operators.push(
|
||||
{value: "startswith", text: _lt("starts with")},
|
||||
{value: "not_startswith", text: _lt("doesn't start with")},
|
||||
{value: "endswith", text: _lt("ends with")},
|
||||
{value: "not_endswith", text: _lt("doesn't end with")},
|
||||
{value: '=ilike', text: _lt("matches")}
|
||||
);
|
||||
|
||||
|
@ -17,7 +19,9 @@ odoo.define('web_advanced_search_wildcard', function (require) {
|
|||
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()]];
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue