diff --git a/setup/web_advanced_search_wildcard/odoo/addons/web_advanced_search_wildcard b/setup/web_advanced_search_wildcard/odoo/addons/web_advanced_search_wildcard new file mode 120000 index 00000000..e29a145a --- /dev/null +++ b/setup/web_advanced_search_wildcard/odoo/addons/web_advanced_search_wildcard @@ -0,0 +1 @@ +../../../../web_advanced_search_wildcard \ No newline at end of file diff --git a/setup/web_advanced_search_wildcard/setup.py b/setup/web_advanced_search_wildcard/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/web_advanced_search_wildcard/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/web_advanced_search_wildcard/README.rst b/web_advanced_search_wildcard/README.rst new file mode 100644 index 00000000..8fa5a8bc --- /dev/null +++ b/web_advanced_search_wildcard/README.rst @@ -0,0 +1,101 @@ +=========================== +Wildcard in advanced search +=========================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github + :target: https://github.com/OCA/web/tree/12.0/web_advanced_search_wildcard + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_advanced_search_wildcard + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/162/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds new options to advanced search of char, many2one, +many2many and one2many fields: + +* *starts with* (uses the domain *=ilike %*), +* *doesn't start with* (uses the domain *not ilike %*), +* *ends with* (uses the domain *=ilike %*), +* *doesn't end with* (uses the domain *not ilike %*), +* *matches* (uses the domain *=ilike *). + + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +When selecting *matches*, use **%** as a placeholder. + +Example: "Zip" - 'matches' - "1%" gives all zip starting with 1 + +.. image:: https://raw.githubusercontent.com/web_advanced_search_wildcard/static/description/screenshot.png + :alt: Screenshot + +Also allows insensitive exact search. +Example "Name" - 'matches' - "john" will find "John" and "john" but not "Johnson". + + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* initOS GmbH & Co. KG +* Therp BV + +Contributors +~~~~~~~~~~~~ + +* Markus Schneider +* Thomas Rehn +* L Freeke +* Alex Comba +* Alexis de Lattre +* Souheil Bejaoui + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/web `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/web_advanced_search_wildcard/__init__.py b/web_advanced_search_wildcard/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/web_advanced_search_wildcard/__manifest__.py b/web_advanced_search_wildcard/__manifest__.py new file mode 100644 index 00000000..65fd7955 --- /dev/null +++ b/web_advanced_search_wildcard/__manifest__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Copyright 2014 initOS GmbH & Co. KG (). +# Copyright 2016 Therp BV . +# Copyright 2017 Alex Comba - Agile Business Group +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Wildcard in advanced search", + "summary": "Webmodule to add wildcard operators in advanced search field", + "version": "12.0.1.0.0", + "category": "web", + "license": "AGPL-3", + "author": "initOS GmbH & Co. KG, Therp BV, " + "Odoo Community Association (OCA)", + "application": False, + "installable": True, + "depends": [ + "web" + ], + "data": [ + "views/template.xml", + ], +} diff --git a/web_advanced_search_wildcard/i18n/de.po b/web_advanced_search_wildcard/i18n/de.po new file mode 100644 index 00000000..943fd9ec --- /dev/null +++ b/web_advanced_search_wildcard/i18n/de.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_advanced_search_wildcard +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-03 03:49+0000\n" +"PO-Revision-Date: 2018-01-03 03:49+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:11 +#, python-format +msgid "ends with" +msgstr "" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:12 +#, python-format +msgid "matches" +msgstr "gleicht" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:10 +#, python-format +msgid "starts with" +msgstr "" diff --git a/web_advanced_search_wildcard/i18n/es.po b/web_advanced_search_wildcard/i18n/es.po new file mode 100644 index 00000000..4067562a --- /dev/null +++ b/web_advanced_search_wildcard/i18n/es.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_advanced_search_wildcard +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-03 03:49+0000\n" +"PO-Revision-Date: 2018-01-03 03:49+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:11 +#, python-format +msgid "ends with" +msgstr "" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:12 +#, python-format +msgid "matches" +msgstr "coincide con" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:10 +#, python-format +msgid "starts with" +msgstr "" diff --git a/web_advanced_search_wildcard/i18n/fi.po b/web_advanced_search_wildcard/i18n/fi.po new file mode 100644 index 00000000..c10f82a8 --- /dev/null +++ b/web_advanced_search_wildcard/i18n/fi.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_advanced_search_wildcard +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-03 03:49+0000\n" +"PO-Revision-Date: 2018-01-03 03:49+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n" +"Language: fi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:11 +#, python-format +msgid "ends with" +msgstr "" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:12 +#, python-format +msgid "matches" +msgstr "osumat" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:10 +#, python-format +msgid "starts with" +msgstr "" diff --git a/web_advanced_search_wildcard/i18n/fr.po b/web_advanced_search_wildcard/i18n/fr.po new file mode 100644 index 00000000..dc14e033 --- /dev/null +++ b/web_advanced_search_wildcard/i18n/fr.po @@ -0,0 +1,38 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_advanced_search_wildcard +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-12-25 23:17+0000\n" +"PO-Revision-Date: 2018-12-25 23:17+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:11 +#, python-format +msgid "ends with" +msgstr "finit par" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:12 +#, python-format +msgid "matches" +msgstr "correspond à" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:10 +#, python-format +msgid "starts with" +msgstr "commence par" diff --git a/web_advanced_search_wildcard/i18n/it.po b/web_advanced_search_wildcard/i18n/it.po new file mode 100644 index 00000000..7c8f95f7 --- /dev/null +++ b/web_advanced_search_wildcard/i18n/it.po @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_advanced_search_wildcard +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-12 08:19+0000\n" +"PO-Revision-Date: 2017-12-12 09:25+0100\n" +"Last-Translator: Alex Comba \n" +"Language-Team: \n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" +"X-Generator: Poedit 2.0.4\n" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:11 +#, python-format +msgid "ends with" +msgstr "" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:12 +#, python-format +msgid "matches" +msgstr "corrisponde a" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:10 +#, python-format +msgid "starts with" +msgstr "" diff --git a/web_advanced_search_wildcard/i18n/lt.po b/web_advanced_search_wildcard/i18n/lt.po new file mode 100644 index 00000000..523c8b3e --- /dev/null +++ b/web_advanced_search_wildcard/i18n/lt.po @@ -0,0 +1,41 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_advanced_search_wildcard +# +# Translators: +# Viktoras Norkus , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-25 01:58+0000\n" +"PO-Revision-Date: 2018-01-25 01:58+0000\n" +"Last-Translator: Viktoras Norkus , 2018\n" +"Language-Team: Lithuanian (https://www.transifex.com/oca/teams/23907/lt/)\n" +"Language: lt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n" +"%100<10 || n%100>=20) ? 1 : 2);\n" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:11 +#, python-format +msgid "ends with" +msgstr "" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:12 +#, python-format +msgid "matches" +msgstr "atitinka" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:10 +#, python-format +msgid "starts with" +msgstr "" diff --git a/web_advanced_search_wildcard/i18n/pt_BR.po b/web_advanced_search_wildcard/i18n/pt_BR.po new file mode 100644 index 00000000..f2173bf8 --- /dev/null +++ b/web_advanced_search_wildcard/i18n/pt_BR.po @@ -0,0 +1,41 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_advanced_search_wildcard +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-03 03:49+0000\n" +"PO-Revision-Date: 2018-01-03 03:49+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" +"teams/23907/pt_BR/)\n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:11 +#, python-format +msgid "ends with" +msgstr "" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:12 +#, python-format +msgid "matches" +msgstr "resultados" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:10 +#, python-format +msgid "starts with" +msgstr "" diff --git a/web_advanced_search_wildcard/i18n/sl.po b/web_advanced_search_wildcard/i18n/sl.po new file mode 100644 index 00000000..7dff4452 --- /dev/null +++ b/web_advanced_search_wildcard/i18n/sl.po @@ -0,0 +1,41 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_advanced_search_wildcard +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-03 03:49+0000\n" +"PO-Revision-Date: 2018-01-03 03:49+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" +"%100==4 ? 2 : 3);\n" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:11 +#, python-format +msgid "ends with" +msgstr "" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:12 +#, python-format +msgid "matches" +msgstr "ujemanj" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:10 +#, python-format +msgid "starts with" +msgstr "" diff --git a/web_advanced_search_wildcard/i18n/tr.po b/web_advanced_search_wildcard/i18n/tr.po new file mode 100644 index 00000000..e5c32e72 --- /dev/null +++ b/web_advanced_search_wildcard/i18n/tr.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_advanced_search_wildcard +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-03 03:49+0000\n" +"PO-Revision-Date: 2018-01-03 03:49+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n" +"Language: tr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:11 +#, python-format +msgid "ends with" +msgstr "" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:12 +#, python-format +msgid "matches" +msgstr "Eşleşmeler" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:10 +#, python-format +msgid "starts with" +msgstr "" diff --git a/web_advanced_search_wildcard/i18n/web_advanced_search_wildcard.pot b/web_advanced_search_wildcard/i18n/web_advanced_search_wildcard.pot new file mode 100644 index 00000000..4c00ea0b --- /dev/null +++ b/web_advanced_search_wildcard/i18n/web_advanced_search_wildcard.pot @@ -0,0 +1,36 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_advanced_search_wildcard +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:11 +#, python-format +msgid "ends with" +msgstr "" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:12 +#, python-format +msgid "matches" +msgstr "" + +#. module: web_advanced_search_wildcard +#. openerp-web +#: code:addons/web_advanced_search_wildcard/static/src/js/search.js:10 +#, python-format +msgid "starts with" +msgstr "" + diff --git a/web_advanced_search_wildcard/readme/CONTRIBUTORS.rst b/web_advanced_search_wildcard/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..88870716 --- /dev/null +++ b/web_advanced_search_wildcard/readme/CONTRIBUTORS.rst @@ -0,0 +1,6 @@ +* Markus Schneider +* Thomas Rehn +* L Freeke +* Alex Comba +* Alexis de Lattre +* Souheil Bejaoui diff --git a/web_advanced_search_wildcard/readme/DESCRIPTION.rst b/web_advanced_search_wildcard/readme/DESCRIPTION.rst new file mode 100644 index 00000000..30296f89 --- /dev/null +++ b/web_advanced_search_wildcard/readme/DESCRIPTION.rst @@ -0,0 +1,9 @@ +This module adds new options to advanced search of char, many2one, +many2many and one2many fields: + +* *starts with* (uses the domain *=ilike %*), +* *doesn't start with* (uses the domain *not ilike %*), +* *ends with* (uses the domain *=ilike %*), +* *doesn't end with* (uses the domain *not ilike %*), +* *matches* (uses the domain *=ilike *). + diff --git a/web_advanced_search_wildcard/readme/USAGE.rst b/web_advanced_search_wildcard/readme/USAGE.rst new file mode 100644 index 00000000..fc18bdc6 --- /dev/null +++ b/web_advanced_search_wildcard/readme/USAGE.rst @@ -0,0 +1,10 @@ +When selecting *matches*, use **%** as a placeholder. + +Example: "Zip" - 'matches' - "1%" gives all zip starting with 1 + +.. image:: /web_advanced_search_wildcard/static/description/screenshot.png + :alt: Screenshot + +Also allows insensitive exact search. +Example "Name" - 'matches' - "john" will find "John" and "john" but not "Johnson". + diff --git a/web_advanced_search_wildcard/static/description/icon.png b/web_advanced_search_wildcard/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/web_advanced_search_wildcard/static/description/icon.png differ diff --git a/web_advanced_search_wildcard/static/description/index.html b/web_advanced_search_wildcard/static/description/index.html new file mode 100644 index 00000000..a6ee043f --- /dev/null +++ b/web_advanced_search_wildcard/static/description/index.html @@ -0,0 +1,442 @@ + + + + + + +Wildcard in advanced search + + + + + + diff --git a/web_advanced_search_wildcard/static/description/screenshot.png b/web_advanced_search_wildcard/static/description/screenshot.png new file mode 100644 index 00000000..57848f90 Binary files /dev/null and b/web_advanced_search_wildcard/static/description/screenshot.png differ diff --git a/web_advanced_search_wildcard/static/src/js/search.js b/web_advanced_search_wildcard/static/src/js/search.js new file mode 100644 index 00000000..6c6a70b5 --- /dev/null +++ b/web_advanced_search_wildcard/static/src/js/search.js @@ -0,0 +1,29 @@ +odoo.define('web_advanced_search_wildcard', function (require) { + "use strict"; + + var core = require('web.core'); + var Char = core.search_filters_registry.get('char') + var _lt = core._lt; + + 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")} + ); + + Char.include({ + get_domain: function (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()]]; + } + }, + }); +}); diff --git a/web_advanced_search_wildcard/views/template.xml b/web_advanced_search_wildcard/views/template.xml new file mode 100644 index 00000000..dbdff601 --- /dev/null +++ b/web_advanced_search_wildcard/views/template.xml @@ -0,0 +1,10 @@ + + + +