Skip to content

Commit

Permalink
Merge ce1c9ac into 1e70c4d
Browse files Browse the repository at this point in the history
  • Loading branch information
gfcapalbo committed Apr 30, 2018
2 parents 1e70c4d + ce1c9ac commit afc8627
Show file tree
Hide file tree
Showing 9 changed files with 592 additions and 0 deletions.
58 changes: 58 additions & 0 deletions web_advanced_search_x2x/README.rst
@@ -0,0 +1,58 @@
Search for x2x records in advanced search
=========================================

Standard behavior in advanced search for one2many, many2many and many2one fields is to do a `name_search`. This often is not satisfactionary as you might want to search for other properties. There might also be cases where you don't exactly know what you're searching for, then a list of possible options is necessary too. This module enables you to have a full search view to select the record in question, and either select specific records or select them using a search query of its own.

Backported from 8.0 to 7.0, the same functionality that appears in the new v8 search area will appear in the v7 search dropdown.
To improve usability a small javascript modification has been introduced so that the main search popup doesn't close when closing the advanced search domain popups.



Usage
=====

To use this module, you need to:

* open the advanced search options in a search view
* select a one2many, many2many or many2one field
* select operator `is equal to` or `is not equal to`
* the textfield changes to a many2one selection field where you can search for the record in question

To search for properties of linked records (ie invoices for customers with a credit limit higher than X):

* open the advanced search options in a search view
* select a one2many, many2many or many2one field
* select operator `is in selection`
* in the search view that pops up, select the criteria
* click `Use criteria`
* if you're only interested in certain records, mark them en click `Select`
* if you want to change your selection afterwards, click the search symbol right of the selection term

In both cases, don't forget to click `Apply` to actually execute the search.

Note that you can stack searching for properties: Simply add another advanced search in the selection search window. You can do this indefinetely, so it is possible to search for moves belonging to a journal which has a user who is member of a certain group etc.

For further information, please visit:

* https://www.odoo.com/forum/help-1

Credits
=======

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

* Holger Brunn <hbrunn@therp.nl>

Maintainer
----------

.. image:: http://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: http://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 http://odoo-community.org.
20 changes: 20 additions & 0 deletions web_advanced_search_x2x/__init__.py
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2015 Therp BV <http://therp.nl>.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
45 changes: 45 additions & 0 deletions web_advanced_search_x2x/__openerp__.py
@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2015 Therp BV <http://therp.nl>.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
"name": "Search x2x fields",
"version": "1.0",
"author": "Therp BV, "
"Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Usability",
"summary": "Use a search widget in advanced search for x2x fields",
"depends": [
'web',
],
"qweb": [
'static/src/xml/web_advanced_search_x2x.xml',
],
'js': ['static/src/js/*.js'],
'css': ['static/src/css/*.css'],
"test": [
],
"auto_install": False,
"installable": True,
"application": False,
"external_dependencies": {
'python': [],
},
}
38 changes: 38 additions & 0 deletions web_advanced_search_x2x/i18n/nl.po
@@ -0,0 +1,38 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_advanced_search_x2x
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-27 07:19+0000\n"
"PO-Revision-Date: 2015-05-27 07:19+0000\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_x2x
#. openerp-web
#: code:addons/web_advanced_search_x2x/static/src/js/web_advanced_search_x2x.js:221
#, python-format
msgid "Use criteria"
msgstr "Gebruik kenmerken"

#. module: web_advanced_search_x2x
#. openerp-web
#: code:addons/web_advanced_search_x2x/static/src/js/web_advanced_search_x2x.js:159
#, python-format
msgid "invalid search domain"
msgstr "ongeldige zoekopdracht"

#. module: web_advanced_search_x2x
#. openerp-web
#: code:addons/web_advanced_search_x2x/static/src/js/web_advanced_search_x2x.js:47
#, python-format
msgid "is in selection"
msgstr "is in selectie"

53 changes: 53 additions & 0 deletions web_advanced_search_x2x/i18n/web_advanced_search_x2x.pot
@@ -0,0 +1,53 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_advanced_search_x2x
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-27 07:19+0000\n"
"PO-Revision-Date: 2015-05-27 07:19+0000\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_x2x
#. openerp-web
#: code:addons/web_advanced_search_x2x/static/src/js/web_advanced_search_x2x.js:295
#: code:addons/web_advanced_search_x2x/static/src/js/web_advanced_search_x2x.js:322
#, python-format
msgid "Advanced"
msgstr ""

#. module: web_advanced_search_x2x
#. openerp-web
#: code:addons/web_advanced_search_x2x/static/src/xml/web_advanced_search_x2x.xml:8
#, python-format
msgid "Search"
msgstr ""

#. module: web_advanced_search_x2x
#. openerp-web
#: code:addons/web_advanced_search_x2x/static/src/js/web_advanced_search_x2x.js:221
#, python-format
msgid "Use criteria"
msgstr ""

#. module: web_advanced_search_x2x
#. openerp-web
#: code:addons/web_advanced_search_x2x/static/src/js/web_advanced_search_x2x.js:159
#, python-format
msgid "invalid search domain"
msgstr ""

#. module: web_advanced_search_x2x
#. openerp-web
#: code:addons/web_advanced_search_x2x/static/src/js/web_advanced_search_x2x.js:47
#, python-format
msgid "is in selection"
msgstr ""

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions web_advanced_search_x2x/static/src/css/web_advanced_search_x2x.css
@@ -0,0 +1,36 @@
.openerp .searchview_extended_prop_value .oe_form_field_with_button
{
position: relative;
}
.openerp .oe_searchview_drawer .web_advanced_search_x2x_domain
{
max-width: 20em;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
}
/* copy search view's button style */
.openerp .oe_searchview_drawer .web_advanced_search_x2x_search:before
{
font: 21px "mnmliconsRegular";
content: "r";
color: #a3a3a3;
margin-left: 5px;
}
.openerp .oe_searchview_drawer .web_advanced_search_x2x_search
{
font-size: 1px;
letter-spacing: -1px;
color: transparent;
text-shadow: none;
font-weight: normal;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
padding: 0;
border: none;
background: transparent;
}

0 comments on commit afc8627

Please sign in to comment.