-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[19.0][MIG] base_search_fuzzy: Migration to 19.0 #3620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
df8bdb1
Renamed module base_trgm_search to base_search_fuzzy, added Unit test…
0016c70
Fix typo
dreispt 48c8e9d
OCA Transbot updated translations from Transifex
oca-transbot e8b75f5
Migrated base_search_fuzzy to v9
serpentcs-dev1 4449eca
OCA Transbot updated translations from Transifex
oca-transbot f293187
base_search_fuzzy: Upgrade to v10 * Rename manifest * Update openerp …
lasley 55d08a3
OCA Transbot updated translations from Transifex
oca-transbot 526ea06
Typos
gdgellatly 04a296a
OCA Transbot updated translations from Transifex
oca-transbot 6859ffa
base_search_fuzzy: Migration to 11.0
cubells e22486b
Update base_search_fuzzy.pot
oca-travis b725b70
base_search_fuzzy: Migration to 12.0
ernestotejeda 1aa25b8
Update base_search_fuzzy.pot
oca-travis 83bd136
Update translation files
oca-transbot b467348
icon.png
OCA-git-bot 244094f
Translated using Weblate (Portuguese)
pedrocs-exo eb61f3e
Translated using Weblate (Portuguese (Brazil))
818d993
Translated using Weblate (Chinese (Simplified))
liweijie0812 10e0fd6
base_search_fuzzy: black, isort
3080ee1
base_search_fuzzy: Migration to 13.0
0adb326
Update translation files
oca-transbot 5480eb1
Eficent -> ForgeFlow
MiquelRForgeFlow 473d7ca
base_search_fuzzy: black, isort, prettier
AreebSiddiqiIR 07137e8
base_search_fuzzy: Migration to 14.0
AreebSiddiqiIR 85318a7
base_search_fuzzy: correct patching, remove similarity order
0c63b91
Update translation files
oca-transbot 2e82fd6
Translated using Weblate (Portuguese (Brazil))
b7c3b41
base_search_fuzzy: black, isort, prettier
Shide 1dc2709
base_search_fuzzy: Migration to 15.0
Shide 8ced236
Translated using Weblate (Spanish (Argentina))
ibuioli 175e9e8
[MIG] base_search_fuzzy: Migrated to v16
Nikul-OSI 8094463
Update translation files
weblate 6926f5b
Translated using Weblate (Italian)
mymage f6f5fa4
Translated using Weblate (Slovenian)
sysadminmatmoz 20a9ba2
[UPD] Update base_search_fuzzy.pot
6844a00
Update translation files
weblate 5e36f3b
Translated using Weblate (Spanish)
Ivorra78 fbe2aae
Translated using Weblate (Italian)
mymage 62acb01
[IMP] base_search_fuzzy: pre-commit auto fixes
nguyenminhchien e1403b9
[MIG] base_search_fuzzy: Migration to 17.0
nguyenminhchien 17e54a9
[UPD] Update base_search_fuzzy.pot
876434f
[BOT] post-merge updates
OCA-git-bot ad2a7e1
[IMP] base_search_fuzzy: pre-commit auto fixes
map-240221 979e34d
[MIG] base_search_fuzzy: Migration to 18.0
map-240221 88d0b5e
[UPD] Update base_search_fuzzy.pot
bc7b98d
[BOT] post-merge updates
OCA-git-bot a1fd9da
Translated using Weblate (Dutch)
bosd 0251f5d
[IMP] base_search_fuzzy - add support of translatable fields
yvaucher a08a872
[UPD] Update base_search_fuzzy.pot
5c17ec4
[BOT] post-merge updates
OCA-git-bot d877e69
Update translation files
weblate 59b5d50
Translated using Weblate (Italian)
mymage 99e1e0b
[IMP] base_search_fuzzy: pre-commit auto fixes
dnplkndll 63d1654
[MIG] base_search_fuzzy: Migration to 19.0
dnplkndll File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,158 @@ | ||
| .. image:: https://odoo-community.org/readme-banner-image | ||
| :target: https://odoo-community.org/get-involved?utm_source=readme | ||
| :alt: Odoo Community Association | ||
|
|
||
| ============ | ||
| Fuzzy Search | ||
| ============ | ||
|
|
||
| .. | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! This file is generated by oca-gen-addon-readme !! | ||
| !! changes will be overwritten. !! | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! source digest: sha256:34ba1dcdd338caeda33db67951dc8ba37243ebf42c273bf00f27b800a2134abe | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
|
||
| .. |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/license-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%2Fserver--tools-lightgray.png?logo=github | ||
| :target: https://github.com/OCA/server-tools/tree/19.0/base_search_fuzzy | ||
| :alt: OCA/server-tools | ||
| .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
| :target: https://translation.odoo-community.org/projects/server-tools-19-0/server-tools-19-0-base_search_fuzzy | ||
| :alt: Translate me on Weblate | ||
| .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png | ||
| :target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=19.0 | ||
| :alt: Try me on Runboat | ||
|
|
||
| |badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
|
||
| This addon provides the ability to create GIN or GiST indexes of char | ||
| and text fields and also to use the search operator % in search domains. | ||
| Currently this module doesn't change the backend search or anything | ||
| else. It provides only the possibility to perform the fuzzy search for | ||
| external addons. | ||
|
|
||
| **Table of contents** | ||
|
|
||
| .. contents:: | ||
| :local: | ||
|
|
||
| Installation | ||
| ============ | ||
|
|
||
| 1. The PostgreSQL extension ``pg_trgm`` should be available. In debian | ||
| based distribution you have to install the postgresql-contrib module. | ||
| 2. Install the ``pg_trgm`` extension to your database or give your | ||
| postgresql user the ``SUPERUSER`` right (this allows the odoo module | ||
| to install the extension to the database). | ||
|
|
||
| Configuration | ||
| ============= | ||
|
|
||
| If the odoo module is installed: | ||
|
|
||
| 1. You can define ``GIN`` and ``GiST`` indexes for char and text via | ||
| Settings -> Database Structure -> Trigram Index. The index name will | ||
| automatically created for new entries. | ||
|
|
||
| Usage | ||
| ===== | ||
|
|
||
| 1. You can create an index for the name field of res.partner. | ||
|
|
||
| 2. In the search you can use: | ||
|
|
||
| ``self.env['res.partner'].search([('name', '%', 'Jon Smit')])`` | ||
|
|
||
| 3. In this example the function will return positive result for John | ||
| Smith or John Smit. | ||
|
|
||
| 4. You can tweak the number of strings to be returned by adjusting the | ||
| set limit (default: 0.3). NB: Currently you have to set the limit by | ||
| executing the following SQL statement: | ||
|
|
||
| ``self.env.cr.execute("SELECT set_limit(0.2);")`` | ||
|
|
||
| For further questions read the Documentation of the | ||
| `pg_trgm <https://www.postgresql.org/docs/current/static/pgtrgm.html>`__ | ||
| module. | ||
|
|
||
| Usage with demo data | ||
| -------------------- | ||
|
|
||
| There are some demo data that allow you to test functionally this module | ||
| if you are in a **demo** database. The steps are the following: | ||
|
|
||
| 1. Go to *Contacts* and type the text **Jon Smith** or **Smith John** in | ||
| the search box and select **Search Display Name for: ...** | ||
| 2. You will see two contacts, and they are the ones with display names | ||
| **John Smith** and **John Smizz**. | ||
|
|
||
| Known issues / Roadmap | ||
| ====================== | ||
|
|
||
| - Modify the general search parts (e.g. in tree view or many2one fields) | ||
| - Add better order by handling | ||
| - This module will not be necessary from version 16 (`[IMP] Better | ||
| handling of indexes | ||
| #83015 <https://github.com/odoo/odoo/pull/83015>`__) | ||
|
|
||
| Bug Tracker | ||
| =========== | ||
|
|
||
| Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/issues>`_. | ||
| In case of trouble, please check there if your issue has already been reported. | ||
| If you spotted it first, help us to smash it by providing a detailed and welcomed | ||
| `feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20base_search_fuzzy%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
|
||
| Do not contact contributors directly about support or help with technical issues. | ||
|
|
||
| Credits | ||
| ======= | ||
|
|
||
| Authors | ||
| ------- | ||
|
|
||
| * bloopark systems GmbH & Co. KG | ||
| * ForgeFlow | ||
| * Serpent CS | ||
|
|
||
| Contributors | ||
| ------------ | ||
|
|
||
| - Christoph Giesel <https://github.com/christophlsa> | ||
| - Jordi Ballester <jordi.ballester@forgeflow.com> | ||
| - Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com> | ||
| - Dave Lasley <dave@laslabs.com> | ||
| - `Tecnativa <https://www.tecnativa.com>`__: | ||
|
|
||
| - Vicent Cubells | ||
| - Ernesto Tejeda | ||
|
|
||
| - teodoralexandru@nexterp.ro 2020 NextERP SRL. | ||
| - Daniel Reis <dreis@opensourceintegrators.com> | ||
| - Nikul Chaudhary <nchaudhary@opensourceintegrators.com> | ||
| - Nguyen Minh Chien <chien@trobz.com> | ||
|
|
||
| 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/server-tools <https://github.com/OCA/server-tools/tree/19.0/base_search_fuzzy>`_ project on GitHub. | ||
|
|
||
| You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Copyright 2016 ForgeFlow S.L. | ||
| # Copyright 2016 Serpent Consulting Services Pvt. Ltd. | ||
| # Copyright 2020 NextERP SRL. | ||
| # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
| from . import models |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Copyright 2016 ForgeFlow S.L. | ||
| # Copyright 2016 Serpent Consulting Services Pvt. Ltd. | ||
| # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
| { | ||
| "name": "Fuzzy Search", | ||
| "summary": "Fuzzy search with the PostgreSQL trigram extension", | ||
| "category": "Uncategorized", | ||
| "version": "19.0.1.0.0", | ||
| "website": "https://github.com/OCA/server-tools", | ||
| "author": "bloopark systems GmbH & Co. KG, " | ||
| "ForgeFlow, " | ||
| "Serpent CS, " | ||
| "Odoo Community Association (OCA)", | ||
| "license": "AGPL-3", | ||
| "depends": ["base"], | ||
| "data": ["views/trgm_index.xml", "security/ir.model.access.csv"], | ||
| "demo": ["demo/res_partner_demo.xml", "demo/TrgmIndex_demo.xml"], | ||
| "installable": True, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| <odoo> | ||
| <record id="trgm_index_gin_partner_name" model="trgm.index"> | ||
| <field name="field_id" ref="base.field_res_partner__name" /> | ||
| <field name="index_type">gin</field> | ||
| <field name="lang">en_US</field> | ||
| </record> | ||
| </odoo> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| <odoo> | ||
| <record id="res_partner_John_Smith" model="res.partner"> | ||
| <field name="name">John Smith</field> | ||
| </record> | ||
|
|
||
| <record id="res_partner_John_Smizz" model="res.partner"> | ||
| <field name="name">John Smizz</field> | ||
| </record> | ||
|
|
||
| <record id="res_partner_Linus_Torvalds" model="res.partner"> | ||
| <field name="name">Linus Torvalds</field> | ||
| </record> | ||
|
|
||
| <record id="view_res_partner_filter" model="ir.ui.view"> | ||
| <field name="model">res.partner</field> | ||
| <field name="inherit_id" ref="base.view_res_partner_filter" /> | ||
| <field name="arch" type="xml"> | ||
| <field name="name" position="after"> | ||
| <field name="complete_name" operator="%" /> | ||
| </field> | ||
| </field> | ||
| </record> | ||
| </odoo> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| # Translation of Odoo Server. | ||
| # This file contains the translation of the following modules: | ||
| # * base_search_fuzzy | ||
| # | ||
| # Translators: | ||
| # OCA Transbot <transbot@odoo-community.org>, 2017 | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Odoo Server 10.0c\n" | ||
| "Report-Msgid-Bugs-To: \n" | ||
| "POT-Creation-Date: 2017-01-14 04:21+0000\n" | ||
| "PO-Revision-Date: 2017-01-14 04:21+0000\n" | ||
| "Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n" | ||
| "Language-Team: Amharic (https://www.transifex.com/oca/teams/23907/am/)\n" | ||
| "Language: am\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: base_search_fuzzy | ||
| #: model:ir.model.fields,help:base_search_fuzzy.field_trgm_index__index_type | ||
| msgid "" | ||
| "Cite from PostgreSQL documentation: GIN indexes are the preferred text " | ||
| "search index type.See: https://www.postgresql.org/docs/current/textsearch-" | ||
| "indexes.html" | ||
| msgstr "" | ||
|
|
||
| #. module: base_search_fuzzy | ||
| #: model:ir.model.fields,field_description:base_search_fuzzy.field_trgm_index__create_uid | ||
| msgid "Created by" | ||
| msgstr "Creado por" | ||
|
|
||
| #. module: base_search_fuzzy | ||
| #: model:ir.model.fields,field_description:base_search_fuzzy.field_trgm_index__create_date | ||
| msgid "Created on" | ||
| msgstr "Creado en" | ||
|
|
||
| #. module: base_search_fuzzy | ||
| #: model:ir.model.fields,field_description:base_search_fuzzy.field_trgm_index__display_name | ||
| msgid "Display Name" | ||
| msgstr "" | ||
|
|
||
| #. module: base_search_fuzzy | ||
| #: model:ir.model.fields,field_description:base_search_fuzzy.field_trgm_index__field_id | ||
| msgid "Field" | ||
| msgstr "" | ||
|
|
||
| #. module: base_search_fuzzy | ||
| #: model:ir.model.fields.selection,name:base_search_fuzzy.selection__trgm_index__index_type__gin | ||
| msgid "GIN" | ||
| msgstr "" | ||
|
|
||
| #. module: base_search_fuzzy | ||
| #: model:ir.model.fields.selection,name:base_search_fuzzy.selection__trgm_index__index_type__gist | ||
| msgid "GiST" | ||
| msgstr "" | ||
|
|
||
| #. module: base_search_fuzzy | ||
| #: model:ir.model.fields,field_description:base_search_fuzzy.field_trgm_index__id | ||
| msgid "ID" | ||
| msgstr "ID" | ||
|
|
||
| #. module: base_search_fuzzy | ||
| #: model:ir.model.fields,field_description:base_search_fuzzy.field_trgm_index__index_name | ||
| msgid "Index Name" | ||
| msgstr "" | ||
|
|
||
| #. module: base_search_fuzzy | ||
| #: model:ir.model.fields,field_description:base_search_fuzzy.field_trgm_index__index_type | ||
| msgid "Index Type" | ||
| msgstr "" | ||
|
|
||
| #. module: base_search_fuzzy | ||
| #: model:ir.model.fields,field_description:base_search_fuzzy.field_trgm_index__lang | ||
| msgid "Language" | ||
| msgstr "" | ||
|
|
||
| #. module: base_search_fuzzy | ||
| #: model:ir.model.fields,field_description:base_search_fuzzy.field_trgm_index__write_uid | ||
| msgid "Last Updated by" | ||
| msgstr "Última actualización por" | ||
|
|
||
| #. module: base_search_fuzzy | ||
| #: model:ir.model.fields,field_description:base_search_fuzzy.field_trgm_index__write_date | ||
| msgid "Last Updated on" | ||
| msgstr "Última actualización en" | ||
|
|
||
| #. module: base_search_fuzzy | ||
| #: model:ir.model.fields,field_description:base_search_fuzzy.field_trgm_index__smart_search | ||
| msgid "Smart Search" | ||
| msgstr "" | ||
|
|
||
| #. module: base_search_fuzzy | ||
| #: model:ir.model.fields,help:base_search_fuzzy.field_trgm_index__index_name | ||
| msgid "" | ||
| "The index name is automatically generated like fieldname_indextype_idx. If " | ||
| "the index already exists and the index is located in the same table then " | ||
| "this index is reused. If the index is located in another table then a number " | ||
| "is added at the end of the index name." | ||
| msgstr "" | ||
|
|
||
| #. module: base_search_fuzzy | ||
| #. odoo-python | ||
| #: code:addons/base_search_fuzzy/models/trgm_index.py:0 | ||
| msgid "The pg_trgm extension does not exists or cannot be installed." | ||
| msgstr "" | ||
|
|
||
| #. module: base_search_fuzzy | ||
| #: model:ir.actions.act_window,name:base_search_fuzzy.trgm_index_action | ||
| #: model:ir.model,name:base_search_fuzzy.model_trgm_index | ||
| #: model:ir.ui.menu,name:base_search_fuzzy.trgm_index_menu | ||
| msgid "Trigram Index" | ||
| msgstr "" | ||
|
|
||
| #. module: base_search_fuzzy | ||
| #: model:ir.model.fields,help:base_search_fuzzy.field_trgm_index__field_id | ||
| msgid "You can either select a field of type \"text\" or \"char\"." | ||
| msgstr "" | ||
|
|
||
| #. module: base_search_fuzzy | ||
| #: model:ir.model.fields,help:base_search_fuzzy.field_trgm_index__lang | ||
| msgid "You will need one index per installed language." | ||
| msgstr "" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please define a language to prevent the field from being empty if it is required at the view level.
