← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 666367] [NEW] Can't save/create a new filter in V6

 

Public bug reported:

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...

** Affects: openobject-server
     Importance: Undecided
         Status: New

-- 
Can't save/create a new filter in V6
https://bugs.launchpad.net/bugs/666367
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.

Status in OpenObject Server: New

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...





Follow ups

References