Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 121 additions & 0 deletions base_name_search_improved/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

====================
Improved Name Search
====================

Extends the name search feature to use additional, more relaxed
matching methods, and to allow searching into configurable additional
record fields.

The name search is the lookup feature to select a related record.
For example, selecting a Customer on a new Sales order.

For example, typing "john brown" doesn't match "John M. Brown".
The relaxed search also looks up for records containing all the words,
so "John M. Brown" would be a match.
It also tolerates words in a different order, so searching
for "brown john" also works.

.. image:: images/image0.png

Additionally, an Administrator can configure other fields to also lookup into.
For example, Customers could be additionally searched by City or Phone number.

.. image:: images/image2.png

How it works:

Regular name search is performed, and the additional search logic is only
triggered if not enough results are found.
This way, no overhead is added on searches that would normally yield results.

But if not enough results are found, then additional search methods are tried.
The specific methods used are:

- Try regular search on each of the additional fields
- Try ordered word search on each of the search fields
- Try unordered word search on each of the search fields

All results found are presented in that order,
hopefully presenting them in order of relevance.


Installation
============

No specific requirements.


Configuration
=============

The fuzzy search is automatically enabled on all Models.
Note that this only affects typing in related fields.
The regular ``search()``, used in the top right search box, is not affected.

Additional search fields can be configured at Settings > Technical > Database > Models,
using the "Name Search Fields" field.

.. image:: images/image1.png


Usage
=====

Just type into any related field, such as Customer on a Sale Order.


.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/149/9.0

.. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt
.. branch is "8.0" for example

Known issues / Roadmap
======================

* Also use fuzzy search, such as the Levenshtein distance:
https://www.postgresql.org/docs/9.5/static/fuzzystrmatch.html
* The list of additional fields to search could benefit from caching, for efficiency.
* This feature could also be implemented for regular ``search`` on the ``name`` field.


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 smashing it by providing a detailed and welcomed feedback.

Credits
=======

Images
------

* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.

Contributors
------------

* Daniel Reis <https://github.com/dreispt>

Maintainer
----------

.. 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.
2 changes: 2 additions & 0 deletions base_name_search_improved/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from . import models
19 changes: 19 additions & 0 deletions base_name_search_improved/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# © 2016 Daniel Reis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Improved Name Search',
'summary': 'Friendlier search when typing in relation fields',
'version': '9.0.1.0.0',
'category': 'Uncategorized',
'website': 'https://odoo-community.org/',
'author': 'Daniel Reis, Odoo Community Association (OCA)',
'license': 'AGPL-3',
'data': [
'views/ir_model.xml',
],
'depends': [
'base',
],
'installable': True,
}
29 changes: 29 additions & 0 deletions base_name_search_improved/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_name_search_improved
#
# Translators:
# Rudolf Schnapka <rs@techno-flex.de>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-06-17 02:42+0000\n"
"PO-Revision-Date: 2016-06-17 02:42+0000\n"
"Last-Translator: Rudolf Schnapka <rs@techno-flex.de>, 2016\n"
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: de\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: base_name_search_improved
#: model:ir.model,name:base_name_search_improved.model_ir_model
msgid "Models"
msgstr "Modelle"

#. module: base_name_search_improved
#: field:ir.model,name_search_ids:0
msgid "Name Search Fields"
msgstr ""
29 changes: 29 additions & 0 deletions base_name_search_improved/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_name_search_improved
#
# Translators:
# Carles Antoli <carlesantoli@hotmail.com>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-06-17 02:42+0000\n"
"PO-Revision-Date: 2016-06-17 02:42+0000\n"
"Last-Translator: Carles Antoli <carlesantoli@hotmail.com>, 2016\n"
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: es\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: base_name_search_improved
#: model:ir.model,name:base_name_search_improved.model_ir_model
msgid "Models"
msgstr "Modelos"

#. module: base_name_search_improved
#: field:ir.model,name_search_ids:0
msgid "Name Search Fields"
msgstr ""
29 changes: 29 additions & 0 deletions base_name_search_improved/i18n/fi.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_name_search_improved
#
# Translators:
# Jarmo Kortetjärvi <jarmo.kortetjarvi@gmail.com>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-09-21 00:47+0000\n"
"PO-Revision-Date: 2016-09-21 00:47+0000\n"
"Last-Translator: Jarmo Kortetjärvi <jarmo.kortetjarvi@gmail.com>, 2016\n"
"Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: fi\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: base_name_search_improved
#: model:ir.model,name:base_name_search_improved.model_ir_model
msgid "Models"
msgstr "Mallit"

#. module: base_name_search_improved
#: field:ir.model,name_search_ids:0
msgid "Name Search Fields"
msgstr ""
29 changes: 29 additions & 0 deletions base_name_search_improved/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_name_search_improved
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-06-17 02:42+0000\n"
"PO-Revision-Date: 2016-06-17 02:42+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2016\n"
"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: fr\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#. module: base_name_search_improved
#: model:ir.model,name:base_name_search_improved.model_ir_model
msgid "Models"
msgstr "Modèles"

#. module: base_name_search_improved
#: field:ir.model,name_search_ids:0
msgid "Name Search Fields"
msgstr ""
29 changes: 29 additions & 0 deletions base_name_search_improved/i18n/hr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_name_search_improved
#
# Translators:
# Bole <bole@dajmi5.com>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-09-21 00:47+0000\n"
"PO-Revision-Date: 2016-09-21 00:47+0000\n"
"Last-Translator: Bole <bole@dajmi5.com>, 2016\n"
"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: hr\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"

#. module: base_name_search_improved
#: model:ir.model,name:base_name_search_improved.model_ir_model
msgid "Models"
msgstr "Modeli"

#. module: base_name_search_improved
#: field:ir.model,name_search_ids:0
msgid "Name Search Fields"
msgstr ""
29 changes: 29 additions & 0 deletions base_name_search_improved/i18n/hr_HR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_name_search_improved
#
# Translators:
# Bole <bole@dajmi5.com>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-09-21 00:47+0000\n"
"PO-Revision-Date: 2016-09-21 00:47+0000\n"
"Last-Translator: Bole <bole@dajmi5.com>, 2016\n"
"Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/hr_HR/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: hr_HR\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"

#. module: base_name_search_improved
#: model:ir.model,name:base_name_search_improved.model_ir_model
msgid "Models"
msgstr "Modeli"

#. module: base_name_search_improved
#: field:ir.model,name_search_ids:0
msgid "Name Search Fields"
msgstr ""
29 changes: 29 additions & 0 deletions base_name_search_improved/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_name_search_improved
#
# Translators:
# Paolo Valier <paolo.valier@hotmail.it>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-06-17 02:42+0000\n"
"PO-Revision-Date: 2016-06-17 02:42+0000\n"
"Last-Translator: Paolo Valier <paolo.valier@hotmail.it>, 2016\n"
"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: it\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: base_name_search_improved
#: model:ir.model,name:base_name_search_improved.model_ir_model
msgid "Models"
msgstr "Modelli"

#. module: base_name_search_improved
#: field:ir.model,name_search_ids:0
msgid "Name Search Fields"
msgstr ""
29 changes: 29 additions & 0 deletions base_name_search_improved/i18n/pt_BR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_name_search_improved
#
# Translators:
# Armando Vulcano Junior <vulcano@uol.com.br>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-06-17 02:42+0000\n"
"PO-Revision-Date: 2016-06-17 02:42+0000\n"
"Last-Translator: Armando Vulcano Junior <vulcano@uol.com.br>, 2016\n"
"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: pt_BR\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#. module: base_name_search_improved
#: model:ir.model,name:base_name_search_improved.model_ir_model
msgid "Models"
msgstr "Modelos"

#. module: base_name_search_improved
#: field:ir.model,name_search_ids:0
msgid "Name Search Fields"
msgstr ""
Loading