bug with advanced filters

Bug #861350 reported by Aline (OpenERP)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo GTK Client (MOVED TO GITHUB)
Fix Released
Medium
OpenERP sa GTK client R&D
Odoo Server (MOVED TO GITHUB)
Fix Released
Medium
Olivier Dony (Odoo)
Odoo Web (MOVED TO GITHUB)
Invalid
Medium
OpenERP R&D Web Team

Bug Description

in a search view click on advanced filters _> bug :

Client Traceback (most recent call last):
  File "/home/aline/openerp/web/openerp-web/addons/web/common/dispatch.py", line 161, in dispatch
    response["result"] = method(controller, self, **self.params)
  File "/home/aline/openerp/web/openerp-web/addons/web/controllers/main.py", line 628, in search_read
    return self.do_search_read(req, model, fields, offset, limit, domain, sort)
  File "/home/aline/openerp/web/openerp-web/addons/web/controllers/main.py", line 653, in do_search_read
    ids = Model.search(domain, 0, False, sort or False, context)
  File "/home/aline/openerp/web/openerp-web/addons/web/common/openerplib/main.py", line 367, in proxy
    *args)
  File "/home/aline/openerp/web/openerp-web/addons/web/common/openerplib/main.py", line 244, in proxy
    result = self.connector.send(self.service_name, method, *args)
  File "/home/aline/openerp/web/openerp-web/addons/web/common/openerplib/main.py", line 214, in send
    raise fault

Server Traceback (most recent call last):
  File "/home/aline/openerp/server/trunk/openerp/netsvc.py", line 411, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, auth, params)
  File "/home/aline/openerp/server/trunk/openerp/service/web_services.py", line 575, in dispatch
    res = fn(db, uid, *params)
  File "/home/aline/openerp/server/trunk/openerp/osv/osv.py", line 119, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/aline/openerp/server/trunk/openerp/osv/osv.py", line 173, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/aline/openerp/server/trunk/openerp/osv/osv.py", line 164, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/aline/openerp/server/trunk/openerp/osv/orm.py", line 2138, in search
    return self._search(cr, user, args, offset=offset, limit=limit, order=order, context=context, count=count)
  File "/home/aline/openerp/server/trunk/openerp/osv/orm.py", line 4347, in _search
    cr.execute('SELECT "%s".id FROM ' % self._table + from_clause + where_str + order_by + limit_str + offset_str, where_clause_params)
  File "/home/aline/openerp/server/trunk/openerp/sql_db.py", line 153, in wrapper
    return f(self, *args, **kwargs)
  File "/home/aline/openerp/server/trunk/openerp/sql_db.py", line 215, in execute
    res = self._obj.execute(query, params)
ProgrammingError: ERREUR: l'opérateur n'existe pas : integer ~~* unknown
LIGNE 1 : ...er."user_id" = 1) AND ((sale_order."project_id" ilike E'%%...
                                                               ^
ASTUCE : Aucun opérateur ne correspond au nom donné et aux types d'arguments.
Vous devez ajouter des conversions explicites de type.

Related branches

Changed in openerp-web:
importance: Undecided → Medium
status: New → Confirmed
assignee: nobody → OpenERP R&D Web Team (openerp-dev-web)
Revision history for this message
Yogesh (SerpentCS) (yogesh-serpentcs) wrote :

Hello,

This bug fixed on server side because click on advance filter then execute the search method and pass domain based on default field in advance filter. eg. :- If I clicked on advance filter in sale.order then default field analytic account selected and operator contains is selected and this domain pass to server side like :- [['project_id', 'ilike', '']] then server generate the exception. i.e if m2o field pass this type of domain then server generate exception.

Also This Exception generate on gtk-client. e.g. Open sale order view and add field of custom filter, default field is analytic account you need to change the operator contains and click on find button then generate exception from server side.

Thanks,

affects: openerp-web → openobject-server
Changed in openobject-server:
assignee: OpenERP R&D Web Team (openerp-dev-web) → OpenERP's Framework R&D (openerp-dev-framework)
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Well, This seems to be fixed from both the clients i.e GTK / web. The M20 with contains/doesn't contains with the 3rd arg i.e the string to be compared if its blank the clients should ignore them from the domain. As we do for the char case on main search view.

affects: openobject-server → openobject-client
Changed in openobject-client:
assignee: OpenERP's Framework R&D (openerp-dev-framework) → OpenERP sa GTK client R&D (openerp-dev-gtk)
status: Confirmed → In Progress
Changed in openerp-web:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → OpenERP R&D Web Team (openerp-dev-web)
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

Thanks for reporting !

It has been fixed at trunk client @ revision-info:1964 <email address hidden>

regards,

Changed in openobject-client:
status: In Progress → Fix Released
Changed in openerp-web:
status: Confirmed → In Progress
Revision history for this message
Khushbu Modi(openerp) (kmo) wrote :

Hello,

It has been fixed in lp:~openerp-dev/openerp-web/trunk-bug-861350-km.
Revision ID <email address hidden>

Thanks,
kmo.

Changed in openerp-web:
status: In Progress → Fix Committed
Revision history for this message
Khushbu Modi(openerp) (kmo) wrote :
Revision history for this message
Nicolas Vanhoren (OpenERP) (niv-openerp) wrote :

This error is caused by the openerp server throwing an exception when we specify an ilike with an empty string on a many2one.

Changed in openobject-server:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Olivier Dony (OpenERP) (odo-openerp)
Revision history for this message
Nicolas Vanhoren (OpenERP) (niv-openerp) wrote :

Code to reproduce this error, using the openerp client lib:

connection.get_model("sale.order").search([['user_id', '=', 1], ['project_id', 'ilike', '']])

Changed in openerp-web:
status: Fix Committed → Won't Fix
status: Won't Fix → Invalid
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Fix landed in server trunk at rev 3753 revid: <email address hidden>

Changed in openobject-server:
status: Confirmed → Fix Released
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.