Error in method _read_flat of the server

Bug #1269122 reported by Jose Antonio Morales Ponce(vauxoo) - - http://www.vauxoo.com
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
New
Undecided
Unassigned

Bug Description

Traceback (most recent call last):
  File "/home/openerp/instancias/estable/check_bugs/server/openerp/netsvc.py", line 292, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/openerp/instancias/estable/check_bugs/server/openerp/service/web_services.py", line 626, in dispatch
    res = fn(db, uid, *params)
  File "/home/openerp/instancias/estable/check_bugs/server/openerp/osv/osv.py", line 190, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/home/openerp/instancias/estable/check_bugs/server/openerp/osv/osv.py", line 132, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/openerp/instancias/estable/check_bugs/server/openerp/osv/osv.py", line 199, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/openerp/instancias/estable/check_bugs/server/openerp/osv/osv.py", line 187, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/openerp/instancias/estable/check_bugs/server/openerp/osv/orm.py", line 3623, in read
    result = self._read_flat(cr, user, select, fields, context, load)
  File "/home/openerp/instancias/estable/check_bugs/server/openerp/osv/orm.py", line 3746, in _read_flat
    res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
  File "/home/openerp/instancias/estable/check_bugs/server/openerp/osv/fields.py", line 468, in get
    context=context))
  File "/home/openerp/instancias/estable/check_bugs/addons/account/account_invoice.py", line 1166, in name_get
    return [(r['id'], '%s %s' % (r['number'] or types[r['type']], r['name'] or '')) for r in self.read(cr, uid, ids, ['type', 'number', 'name'], context, load='_classic_write')]
  File "/home/openerp/instancias/estable/check_bugs/server/openerp/osv/orm.py", line 3623, in read
    result = self._read_flat(cr, user, select, fields, context, load)
  File "/home/openerp/instancias/estable/check_bugs/server/openerp/osv/orm.py", line 3675, in _read_flat
    cr.execute(query, [tuple(sub_ids)] + rule_params)
  File "/home/openerp/instancias/estable/check_bugs/server/openerp/sql_db.py", line 161, in wrapper
    return f(self, *args, **kwargs)
  File "/home/openerp/instancias/estable/check_bugs/server/openerp/sql_db.py", line 226, in execute
    res = self._obj.execute(query, params)
ProgrammingError: operator does not exist: integer = boolean
LINE 1: ...d FROM "account_invoice" WHERE account_invoice.id IN (false)...
                                                             ^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.

Basically the error is in the get method of the many2one class, line 466 of the fields.py file.

        records = dict(obj.name_get(cr, SUPERUSER_ID,
                                    list(set([x for x in res.values() if isinstance(x, (int,long))])),
                                    context=context))

Because this method receives a False and this is instance of int is why that sends a list with the boolean False, causing a mistake later.

I don't know why receives a False instead of None but is a mistake not consider that booleans (False or True) are instances of int

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.