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 index cbf40557..a1a8d974 100644 --- a/web_advanced_search_wildcard/README.rst +++ b/web_advanced_search_wildcard/README.rst @@ -1,10 +1,29 @@ -.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png - :target: https://www.gnu.org/licenses/agpl - :alt: License: AGPL-3 - -============================ +=========================== 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 3 options to advanced search of char, many2one, many2many and one2many fields: @@ -13,40 +32,47 @@ many2many and one2many fields: * *ends with* (uses the domain *=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:: /web_advanced_search_wildcard/static/description/screenshot.png +.. 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". -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/162/10.0 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 smash it by providing detailed and welcomed feedback. +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 ======= -Images ------- +Authors +~~~~~~~ -* Odoo Community Association: `Icon `_. +* initOS GmbH & Co. KG +* Therp BV Contributors ------------- +~~~~~~~~~~~~ * Markus Schneider * Thomas Rehn @@ -54,19 +80,20 @@ Contributors * Alex Comba * Alexis de Lattre -Do not contact contributors directly about support or help with technical issues. -Maintainer ----------- +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - 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. -To contribute to this module, please visit https://odoo-community.org. +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/__manifest__.py b/web_advanced_search_wildcard/__manifest__.py index 72c59d44..65fd7955 100644 --- a/web_advanced_search_wildcard/__manifest__.py +++ b/web_advanced_search_wildcard/__manifest__.py @@ -6,7 +6,7 @@ { "name": "Wildcard in advanced search", "summary": "Webmodule to add wildcard operators in advanced search field", - "version": "10.0.1.0.0", + "version": "12.0.1.0.0", "category": "web", "license": "AGPL-3", "author": "initOS GmbH & Co. KG, Therp BV, " diff --git a/web_advanced_search_wildcard/readme/CONTRIBUTORS.rst b/web_advanced_search_wildcard/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..9df63506 --- /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 + diff --git a/web_advanced_search_wildcard/readme/DESCRIPTION.rst b/web_advanced_search_wildcard/readme/DESCRIPTION.rst new file mode 100644 index 00000000..6359f371 --- /dev/null +++ b/web_advanced_search_wildcard/readme/DESCRIPTION.rst @@ -0,0 +1,7 @@ +This module adds 3 options to advanced search of char, many2one, +many2many and one2many fields: + +* *starts with* (uses the domain *=ilike %*), +* *ends with* (uses the domain *=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/index.html b/web_advanced_search_wildcard/static/description/index.html new file mode 100644 index 00000000..569088bb --- /dev/null +++ b/web_advanced_search_wildcard/static/description/index.html @@ -0,0 +1,439 @@ + + + + + + +Wildcard in advanced search + + + + + + diff --git a/web_advanced_search_wildcard/static/src/js/search.js b/web_advanced_search_wildcard/static/src/js/search.js index 1fa24bdc..9a424a34 100644 --- a/web_advanced_search_wildcard/static/src/js/search.js +++ b/web_advanced_search_wildcard/static/src/js/search.js @@ -2,17 +2,16 @@ odoo.define('web_advanced_search_wildcard', function (require) { "use strict"; var core = require('web.core'); - var search_filters = require('web.search_filters'); - + var Char = core.search_filters_registry.get('char') var _lt = core._lt; - search_filters.ExtendedSearchProposition.Char.prototype.operators.push( + Char.prototype.operators.push( {value: "startswith", text: _lt("starts with")}, {value: "endswith", text: _lt("ends with")}, {value: '=ilike', text: _lt("matches")} ); - search_filters.ExtendedSearchProposition.Char.include({ + Char.include({ get_domain: function (field, operator) { switch (operator.value) { case '∃': return [[field.name, '!=', false]];