[6.0] web client should use exact match search (=) for searching on fields.selection

Bug #715773 reported by Jacques-Etienne Baudoux
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Web Client
Status tracked in 6.0
6.0
Fix Released
Low
OpenERP R&D Web Team
Trunk
Fix Released
Low
OpenERP R&D Web Team

Bug Description

When you perform a search on a selection field in the web client, the generated expression doesn't use the correct operator "=" but "ilike"
it should be:
[('state', '=', 'draft')]
instead of
[('state', 'ilike', 'draft')]

First it is not correct and secondly, it's breaking the use of the indexes.

Tags: profserv

Related branches

Revision history for this message
DBR (OpenERP) (dbr-openerp) wrote :

Hello Jacques-Etienne,

Search on a selection field with '=' Operator it searches with Specified pattern.
Where as the ' ilike ' operator it searches related with that pattern.
So, It is ok with ' ilike ' if you use it instead of '=' operator.

Thanks.

Changed in openobject-client-web:
status: New → Invalid
Revision history for this message
Jacques-Etienne Baudoux (jbaudoux) wrote :

The domain generated by the search view in the web client is wrong in the case of a selection field.
When I search records with state "draft", I want to search records where state = "draft" like with the GTK client. This will use the indexes in DB. (it cannot use indexes when you perform an "ilike" where query)

Anyway, the behavior is different with the GTK and web client. And it should be fixed in the web client.

Changed in openobject-client-web:
status: Invalid → New
Revision history for this message
DBR (OpenERP) (dbr-openerp) wrote :

Hello Jacques-Etienne,

Would you please elaborate with more information or proper example?
Because I have checked with stable-6 and Trunk code,
But it is working fine at my end.

Thanks.

Changed in openobject-client-web:
status: New → Incomplete
tags: added: profserv
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Indeed, the search operator that the web client must use when sending search to the server is '=', because the values of the selection are fixed. The GTK client does this properly.

Thanks for reporting!

Changed in openobject-client-web:
assignee: nobody → OpenERP SA's Web Client R&D (openerp-dev-web)
importance: Undecided → Low
milestone: none → 6.0.2
status: Incomplete → Confirmed
summary: - [6.0] search on selection fields - ilike and index
+ [6.0] web client should use exact match search (=) for searching on
+ fields.selection
Revision history for this message
Navrang Oza (noz-tiny) wrote :

Hello Jacques-Etienne Baudoux (OpenERP),

Web client is also using '=' and index, for field.selection.
Then also, if you find any specific case (not possible because its generic) then please send us details.

Thanks.

Changed in openobject-client-web:
status: Confirmed → Invalid
Revision history for this message
Jacques-Etienne Baudoux (jbaudoux) wrote :

You can reproduce the bug with this basic module:
lp:~jba-openerp/openobject-server/trunk-bug-715773

You'll see in the server log it generates:
[2011-02-21 20:16:23,112][?] DEBUG_RPC:params: 'bug715773.bug',
[2011-02-21 20:16:23,112][?] DEBUG_RPC:params: 'search',
[2011-02-21 20:16:23,112][?] DEBUG_RPC:params: [('state', 'ilike', 'draft')],

Changed in openobject-client-web:
status: Invalid → Triaged
Changed in openobject-client-web:
status: Triaged → Confirmed
status: Confirmed → In Progress
Revision history for this message
Sananaz (Open ERP) (sma-tiny) wrote :

Hello Jacques-Etienne Baudoux (OpenERP),

The fix for web-client has been committed to lp:~openerp-dev/openobject-client-web/trunk-bug-715773-sma
with the following revision.
Revision-info:
4612 <email address hidden>

Soon it will be merged into trunk web-client.

Thank you for notifying.

Changed in openobject-client-web:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.