Manuel Vázquez Acosta d57cd2d3ce [FIX] base: Correct optimization of name_search
Commit 5fcf891e07 introduced optimizations for
name_search in several models.  However, that produces some counter-intuitive
searches.

In a DB with project and custom data:

    >>> Project = self.env['project.task']
    >>> Project.search([('user_id', 'ilike', 'demo')]).mapped('user_id.name')
    ['Marc Demo']

    >>> Project.search([('user_id', 'not ilike', 'demo')]).mapped('user_id.name')
    ['Marc Demo']

The projects returned with 'not ilike' are a super-set of those returned with
'ilike':

    >>> Project.search([('user_id', 'ilike', 'demo')])
    project.task(22, 21, 20, 16, 14, 13)

    >>> Project.search([('user_id', 'not ilike', 'demo')])
    project.task(22, 21, 29, 28, 27, 26, 25, 20, 16, 14, 13, 31, 30)

This commit fix this behaviour by choosing '!=' instead of '=' whenever the
operator is a negation operator.

The 'res.users' is more exposed than the other models touched by
5fcf891e07, because user may search for 'Created
by' in the web client.

closes odoo/odoo#40140

X-original-commit: b3c539b09a0bd462309a10c565cb91375a7011b9
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-12 14:49:52 +00:00
2015-09-08 15:45:09 +02:00
2019-10-03 12:48:09 +00:00
2015-09-08 17:58:38 +02:00
2019-10-03 12:48:09 +00:00

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

Then follow the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%