mirror of https://github.com/OCA/web.git
Before this patch, when a domain leaf was a string (such as `&`, `|` or `!`), it was being treated as an array. This was leading to errors such as this one: ``` 2017-10-19 11:22:01,578 1 ERROR devel odoo.http: Exception during JSON request handling. Traceback (most recent call last): File "/opt/odoo/custom/src/odoo/odoo/http.py", line 640, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/opt/odoo/custom/src/odoo/odoo/http.py", line 677, in dispatch result = self._call_function(**self.params) File "/opt/odoo/custom/src/odoo/odoo/http.py", line 333, in _call_function return checked_call(self.db, *args, **kwargs) File "/opt/odoo/custom/src/odoo/odoo/service/model.py", line 101, in wrapper return f(dbname, *args, **kwargs) File "/opt/odoo/custom/src/odoo/odoo/http.py", line 326, in checked_call result = self.endpoint(*a, **kw) File "/opt/odoo/custom/src/odoo/odoo/http.py", line 935, in __call__ return self.method(*args, **kw) File "/opt/odoo/custom/src/odoo/odoo/http.py", line 506, in response_wrap response = f(*args, **kw) File "/opt/odoo/auto/addons/web/controllers/main.py", line 827, in search_read return self.do_search_read(model, fields, offset, limit, domain, sort) File "/opt/odoo/auto/addons/web/controllers/main.py", line 849, in do_search_read offset=offset or 0, limit=limit or False, order=sort or False) File "/opt/odoo/custom/src/odoo/odoo/models.py", line 4733, in search_read records = self.search(domain or [], offset=offset, limit=limit, order=order) File "/opt/odoo/custom/src/odoo/odoo/models.py", line 1559, in search res = self._search(args, offset=offset, limit=limit, order=order, count=count) File "/opt/odoo/custom/src/odoo/odoo/models.py", line 4275, in _search query = self._where_calc(args) File "/opt/odoo/custom/src/odoo/odoo/models.py", line 4074, in _where_calc e = expression.expression(domain, self) File "/opt/odoo/custom/src/odoo/odoo/osv/expression.py", line 640, in __init__ self.expression = distribute_not(normalize_domain(domain)) File "/opt/odoo/custom/src/odoo/odoo/osv/expression.py", line 289, in distribute_not elif token in DOMAIN_OPERATORS_NEGATION: TypeError: unhashable type: 'list' ``` Now they are treated specifically and the problem is fixed. |
||
---|---|---|
.. | ||
i18n | ||
static | ||
views | ||
README.rst | ||
__init__.py | ||
__manifest__.py |
README.rst
.. image:: https://img.shields.io/badge/license-LGPL--3-blue.svg :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html :alt: License: LGPL-3 ========================================= 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 * click *Apply* 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 * select the records you want, or select the top corner box to select all matching records with that criteria * click *Select* 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. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot :target: https://runbot.odoo-community.org/runbot/162/10.0 Known issues / Roadmap ====================== * When you use *is in selection* search system and choose a domain, it gets immediately applied, so to add a new condition, you will have to use again the *Filters* menu. Credits ======= Contributors ------------ * Holger Brunn <hbrunn@therp.nl> * Vicent Cubells <vicent.cubells@tecnativa.com> * Jairo Llopis <jairo.llopis@tecnativa.com> * Rami Alwafaie <rami.alwafaie@initos.com> 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.