From eb1b60928b76e1dda24a7983cb6406150c68966b Mon Sep 17 00:00:00 2001 From: gfcapalbo Date: Wed, 17 Jun 2015 16:04:07 +0200 Subject: [PATCH] [IMP] web_advanced_search_x2x: ... * OCA authoring * remove useless licence in an empty file * Clean up manifest --- web_advanced_search_x2x/README.rst | 53 ------------------- web_advanced_search_x2x/__init__.py | 21 +------- web_advanced_search_x2x/__openerp__.py | 52 ++++++++---------- web_advanced_search_x2x/i18n/es.po | 53 +++++++++++++++++++ web_advanced_search_x2x/i18n/fr.po | 53 +++++++++++++++++++ .../src/css/web_advanced_search_x2x.css | 2 +- .../static/src/js/web_advanced_search_x2x.js | 26 ++------- web_advanced_search_x2x/views/templates.xml | 11 ---- 8 files changed, 137 insertions(+), 134 deletions(-) delete mode 100644 web_advanced_search_x2x/README.rst create mode 100644 web_advanced_search_x2x/i18n/es.po create mode 100644 web_advanced_search_x2x/i18n/fr.po delete mode 100644 web_advanced_search_x2x/views/templates.xml diff --git a/web_advanced_search_x2x/README.rst b/web_advanced_search_x2x/README.rst deleted file mode 100644 index f9346d82..00000000 --- a/web_advanced_search_x2x/README.rst +++ /dev/null @@ -1,53 +0,0 @@ -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. - -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 - -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. diff --git a/web_advanced_search_x2x/__init__.py b/web_advanced_search_x2x/__init__.py index faef9dac..37a0e310 100644 --- a/web_advanced_search_x2x/__init__.py +++ b/web_advanced_search_x2x/__init__.py @@ -1,20 +1,3 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# This module copyright (C) 2015 Therp BV . -# -# 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 . -# -############################################################################## +# © 2016 Therp BV . +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/web_advanced_search_x2x/__openerp__.py b/web_advanced_search_x2x/__openerp__.py index 86152e9d..64494ffe 100644 --- a/web_advanced_search_x2x/__openerp__.py +++ b/web_advanced_search_x2x/__openerp__.py @@ -1,45 +1,39 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# This module copyright (C) 2015 Therp BV . -# -# 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 . -# -############################################################################## +# © 2016 Therp BV . +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + { "name": "Search x2x fields", - "version": "1.0", - "author": "Therp BV", + "version": "7.0.1.0.0", + "author": "Therp BV, " + "Odoo Community Association (OCA)", + "description": """ +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. + """, "license": "AGPL-3", "category": "Usability", "summary": "Use a search widget in advanced search for x2x fields", "depends": [ 'web', ], - "data": [ - 'views/templates.xml', - ], "qweb": [ 'static/src/xml/web_advanced_search_x2x.xml', ], - "test": [ - ], + 'js': ['static/src/js/*.js'], + 'css': ['static/src/css/*.css'], "auto_install": False, "installable": True, "application": False, - "external_dependencies": { - 'python': [], - }, } diff --git a/web_advanced_search_x2x/i18n/es.po b/web_advanced_search_x2x/i18n/es.po new file mode 100644 index 00000000..d6d9aea5 --- /dev/null +++ b/web_advanced_search_x2x/i18n/es.po @@ -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 "Avanzado" + +#. 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 "Buscar" + +#. 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 "Usar criterio" + +#. 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 "dominio de búsqueda inválido" + +#. 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 "está en la selección" + diff --git a/web_advanced_search_x2x/i18n/fr.po b/web_advanced_search_x2x/i18n/fr.po new file mode 100644 index 00000000..d030d5ec --- /dev/null +++ b/web_advanced_search_x2x/i18n/fr.po @@ -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" + +#: 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 +#. module: web_advanced_search_x2x +#. openerp-web +#, python-format +msgid "Advanced" +msgstr "Avancé" + +#: code:addons/web_advanced_search_x2x/static/src/xml/web_advanced_search_x2x.xml:8 +#. module: web_advanced_search_x2x +#. openerp-web +#, python-format +msgid "Search" +msgstr "Chercher" + +#: code:addons/web_advanced_search_x2x/static/src/js/web_advanced_search_x2x.js:221 +#. module: web_advanced_search_x2x +#. openerp-web +#, python-format +msgid "Use criteria" +msgstr "Utiliser le critère" + +#: code:addons/web_advanced_search_x2x/static/src/js/web_advanced_search_x2x.js:159 +#. module: web_advanced_search_x2x +#. openerp-web +#, python-format +msgid "invalid search domain" +msgstr "domaine de recherche incorrect" + +#: code:addons/web_advanced_search_x2x/static/src/js/web_advanced_search_x2x.js:47 +#. module: web_advanced_search_x2x +#. openerp-web +#, python-format +msgid "is in selection" +msgstr "parmi la sélection" + diff --git a/web_advanced_search_x2x/static/src/css/web_advanced_search_x2x.css b/web_advanced_search_x2x/static/src/css/web_advanced_search_x2x.css index 67c3e194..aac562ec 100644 --- a/web_advanced_search_x2x/static/src/css/web_advanced_search_x2x.css +++ b/web_advanced_search_x2x/static/src/css/web_advanced_search_x2x.css @@ -4,7 +4,7 @@ } .openerp .oe_searchview_drawer .web_advanced_search_x2x_domain { - max-width: 20em; + max-width: 50em; overflow: hidden; text-overflow: ellipsis; display: inline-block; diff --git a/web_advanced_search_x2x/static/src/js/web_advanced_search_x2x.js b/web_advanced_search_x2x/static/src/js/web_advanced_search_x2x.js index dd226b8f..2f38bb26 100644 --- a/web_advanced_search_x2x/static/src/js/web_advanced_search_x2x.js +++ b/web_advanced_search_x2x/static/src/js/web_advanced_search_x2x.js @@ -1,23 +1,6 @@ -//-*- coding: utf-8 -*- -//############################################################################ -// -// OpenERP, Open Source Management Solution -// This module copyright (C) 2015 Therp BV . -// -// 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 . -// -//############################################################################ +// -*- coding: utf-8 -*- +// © 2016 Therp BV . +// License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). openerp.web_advanced_search_x2x = function(instance) { @@ -190,7 +173,8 @@ openerp.web_advanced_search_x2x = function(instance) }); popup.select_element( this.field.relation, {}, this.field.domain, - this.field.context); + new instance.web.CompoundContext( + instance.session.user_context, this.field.context)); }, }); diff --git a/web_advanced_search_x2x/views/templates.xml b/web_advanced_search_x2x/views/templates.xml deleted file mode 100644 index 29424680..00000000 --- a/web_advanced_search_x2x/views/templates.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - -