Can't save/create a new filter in V6

Bug #666367 reported by Xavier Fernandez http://www.smile.fr
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
High
OpenERP's Framework R&D

Bug Description

Creating or saving a new filter gives this:
  File "/home/xafer/openerp/trunk/server/bin/netsvc.py", line 489, in dispatch
    result = ExportService.getService(service_name).dispatch(method, auth, params)
  File "/home/xafer/openerp/trunk/server/bin/service/web_services.py", line 586, in dispatch
    res = fn(db, uid, *params)
  File "/home/xafer/openerp/trunk/server/bin/osv/osv.py", line 57, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/xafer/openerp/trunk/server/bin/osv/osv.py", line 140, in execute
    res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/xafer/openerp/trunk/server/bin/osv/osv.py", line 130, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/xafer/openerp/trunk/server/bin/osv/orm.py", line 3683, in create
    cr.execute('insert into "'+self._table+'" (id'+upd0+") values ("+str(id_new)+upd1+')', tuple(upd2))
  File "/home/xafer/openerp/trunk/server/bin/sql_db.py", line 75, in wrapper
    return f(self, *args, **kwargs)
  File "/home/xafer/openerp/trunk/server/bin/sql_db.py", line 122, in execute
    res = self._obj.execute(query, params)
DataError: ERREUR: valeur trop longue pour le type character varying(16)

In "ir.field" object, 'model_id' is a selection field (which means a char(16) field in postgres) and
def _list_all_models(self, cr, uid, context=None):
        cr.execute("SELECT model, name from ir_model")
        return cr.fetchall()
gives the list of possible values which are of course longer than 16 characters.

I guess the model_id field of ir.filter should actually be a many2one (maybe with a selection widget on the view). This would solve the issue, and would also be cleaner...

Related branches

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

You are totally right. At the moment you can only save filters for objects whose technical name is shorter than 16 characters!

Thanks for the report!

Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

It has been fixed by revision 2971 <email address hidden>.
Thanks.

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