SQL Error when trying to load main menu

Bug #531988 reported by Mathieu Leduc-Hamel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Web Client
Invalid
Undecided
Unassigned

Bug Description

Just after login into the main menu, I successfully log into OpenERP (web) the different options loaded indefinitely and the server gave me the following error in the main log of errors:

...
  File "/Users/marrakis/Documents/sfl/SFLOpenerp/bin/netsvc.py", line 366, in dispatch
    result = ExportService.getService(service_name).dispatch(method, auth, params)
  File "/Users/marrakis/Documents/sfl/SFLOpenerp/bin/service/web_services.py", line 587, in dispatch
    res = fn(db, uid, *params)
  File "/Users/marrakis/Documents/sfl/SFLOpenerp/bin/osv/osv.py", line 57, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/Users/marrakis/Documents/sfl/SFLOpenerp/bin/osv/osv.py", line 118, in execute
    res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/Users/marrakis/Documents/sfl/SFLOpenerp/bin/osv/osv.py", line 110, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/Users/marrakis/Documents/sfl/SFLOpenerp/bin/osv/orm.py", line 2489, in read
    result = self._read_flat(cr, user, select, fields, context, load)
  File "/Users/marrakis/Documents/sfl/SFLOpenerp/bin/osv/orm.py", line 2556, in _read_flat
    order_by), (sub_ids,))
  File "/Users/marrakis/Documents/sfl/SFLOpenerp/bin/sql_db.py", line 74, in wrapper
    return f(self, *args, **kwargs)
  File "/Users/marrakis/Documents/sfl/SFLOpenerp/bin/sql_db.py", line 119, in execute
    res = self._obj.execute(query, params)
ProgrammingError: operator does not exist: integer = text
LINE 1: ...ELECT "name","icon",id FROM "ir_ui_menu" WHERE id = ANY (ARR...
                                                             ^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.

It work fine when using the GTK client the web client seem to be completely unusable.

Revision history for this message
Sananaz (Open ERP) (sma-tiny) wrote :

Hello,

Can you please tell us, which version you are using?
also give revision number.

Thanks.

Revision history for this message
Mathieu Leduc-Hamel (marrakis) wrote :

I'm using the following configuration:

By the way all component are the stable ones, than I don't have any rev number.

openerp-server = 5.0.7
openerp-web = 5.0.7
postgresql-server = 8.4
psycopg2 = 2.0.13
python = 2.6.4

It's very strange, it seems to be a problem with the ORM. I'll explain:

In sql_db.py, you have a method (line 106):

  def execute(self, query, params=None):
     ...

The problem raised when trying to execute a query like:

  SELECT "name","icon",id FROM "ir_ui_menu" WHERE id = ANY (%s) ORDER BY sequence,id;

But the params were

  params = [('80', '15')]

Values were not of the right type, cause postgres was waiting for an array of int and not string, Then I've just patch it with a simple but ineffective small piece of code:

             if params is not None:
                for param in params:
                    if type(param) == type([]) or type(param) == type(()):
          for p in param:
                            try:
           if int(p) > 0:
                                    params = [(lambda(t):[int(i) for i in t])(v) for v in params]
                                    break
              except:
           pass

And it work ! Than we've to find why there's an array of not correctly cast values given to the cursor !

Do you have any idea cause my small patch is very uggly...

Revision history for this message
Kunal Chavda (kunal-chavda) wrote :

Hello,

Update your openerp-server and openerp-web.
Because at our end we did not face error.

Thanks.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Mathieu,

We have checked it firmly and I assure there is no such error anymore.The code from server is pretty clean and thus this error cannot happen.

We would like to request you get the latest code of released versions and recheck.

You may reopen the bug if it still persists.

Thanks.

Changed in openobject-client-web:
milestone: none → 5.0.13
status: New → Invalid
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.