Skip to content

Commit

Permalink
[MIG] base_search_fuzzy: Migration to 15.0
Browse files Browse the repository at this point in the history
[ADD] Roadmap: Module no longer needed from v16
  • Loading branch information
Shide committed Mar 14, 2022
1 parent 484ca4b commit a7224f1
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 19 deletions.
13 changes: 7 additions & 6 deletions base_search_fuzzy/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ Fuzzy Search
: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:/OCA/server-tools/tree/14.0/base_search_fuzzy
:target: https:/OCA/server-tools/tree/15.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-14-0/server-tools-14-0-base_search_fuzzy
:target: https://translation.odoo-community.org/projects/server-tools-15-0/server-tools-15-0-base_search_fuzzy
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/149/14.0
:target: https://runbot.odoo-community.org/runbot/149/15.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
|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
Expand Down Expand Up @@ -90,14 +90,15 @@ 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:/odoo/odoo/pull/83015>`_)

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https:/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 smashing it by providing a detailed and welcomed
`feedback <https:/OCA/server-tools/issues/new?body=module:%20base_search_fuzzy%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https:/OCA/server-tools/issues/new?body=module:%20base_search_fuzzy%0Aversion:%2015.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.

Expand Down Expand Up @@ -137,6 +138,6 @@ 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:/OCA/server-tools/tree/14.0/base_search_fuzzy>`_ project on GitHub.
This module is part of the `OCA/server-tools <https:/OCA/server-tools/tree/15.0/base_search_fuzzy>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion base_search_fuzzy/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Fuzzy Search",
"summary": "Fuzzy search with the PostgreSQL trigram extension",
"category": "Uncategorized",
"version": "14.0.1.0.1",
"version": "15.0.1.0.0",
"website": "https:/OCA/server-tools",
"author": "bloopark systems GmbH & Co. KG, "
"ForgeFlow, "
Expand Down
2 changes: 1 addition & 1 deletion base_search_fuzzy/i18n/base_search_fuzzy.pot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
Expand Down
2 changes: 0 additions & 2 deletions base_search_fuzzy/models/trgm_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class TrgmIndex(models.Model):
)

index_name = fields.Char(
string="Index Name",
readonly=True,
help="The index name is automatically generated like "
"fieldname_indextype_idx. If the index already exists and the "
Expand All @@ -39,7 +38,6 @@ class TrgmIndex(models.Model):

index_type = fields.Selection(
selection=[("gin", "GIN"), ("gist", "GiST")],
string="Index Type",
default="gin",
required=True,
ondelete={"gin": "set default", "gist": "set default"},
Expand Down
1 change: 1 addition & 0 deletions base_search_fuzzy/readme/ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* 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:/odoo/odoo/pull/83015>`_)
9 changes: 5 additions & 4 deletions base_search_fuzzy/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>Fuzzy Search</title>
<style type="text/css">

Expand Down Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Fuzzy Search</h1>
!! This file is generated by oca-gen-addon-readme !!
!! 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:/OCA/server-tools/tree/14.0/base_search_fuzzy"><img alt="OCA/server-tools" src="https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/server-tools-14-0/server-tools-14-0-base_search_fuzzy"><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/149/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<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:/OCA/server-tools/tree/15.0/base_search_fuzzy"><img alt="OCA/server-tools" src="https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/server-tools-15-0/server-tools-15-0-base_search_fuzzy"><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/149/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This addon provides the ability to create GIN or GiST indexes of char and text
fields and also to use the search operator <cite>%</cite> in search domains. Currently
this module doesn’t change the backend search or anything else. It provides
Expand Down Expand Up @@ -444,14 +444,15 @@ <h1><a class="toc-backref" href="#id5">Known issues / Roadmap</a></h1>
<ul class="simple">
<li>Modify the general search parts (e.g. in tree view or many2one fields)</li>
<li>Add better <cite>order by</cite> handling</li>
<li>This module will not be necessary from version 16 (<a class="reference external" href="https:/odoo/odoo/pull/83015">[IMP] Better handling of indexes #83015</a>.)</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id6">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https:/OCA/server-tools/issues">GitHub Issues</a>.
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
<a class="reference external" href="https:/OCA/server-tools/issues/new?body=module:%20base_search_fuzzy%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https:/OCA/server-tools/issues/new?body=module:%20base_search_fuzzy%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -484,7 +485,7 @@ <h2><a class="toc-backref" href="#id10">Maintainers</a></h2>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https:/OCA/server-tools/tree/14.0/base_search_fuzzy">OCA/server-tools</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https:/OCA/server-tools/tree/15.0/base_search_fuzzy">OCA/server-tools</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
4 changes: 1 addition & 3 deletions base_search_fuzzy/tests/test_query_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ def test_fuzzy_where_generation(self):

def test_fuzzy_where_generation_translatable(self):
"""Check the generation of the where clause for translatable fields."""
ctx = {"lang": "de_DE"}

# create new query with fuzzy search operator
query = self.ResPartnerCategory.with_context(ctx)._where_calc(
query = self.ResPartnerCategory.with_context(lang="de_DE")._where_calc(
[("name", "%", "Goschaeftlic")], active_test=False
)
from_clause, where_clause, where_clause_params = query.get_sql()
Expand Down
4 changes: 2 additions & 2 deletions base_search_fuzzy/views/trgm_index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<field name="name">trgm.index.view.form</field>
<field name="model">trgm.index</field>
<field name="arch" type="xml">
<form string="Trigram Index">
<form>
<sheet>
<group col="4">
<field
Expand All @@ -22,7 +22,7 @@
<field name="name">trgm.index.view.tree</field>
<field name="model">trgm.index</field>
<field name="arch" type="xml">
<tree string="Trigram Index">
<tree>
<field name="field_id" />
<field name="index_name" />
<field name="index_type" />
Expand Down

0 comments on commit a7224f1

Please sign in to comment.