Error when relational field to _inherits is FALSE!

Bug #558528 reported by Alberto Luengo Cabanillas (Pexego)
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Undecided
Unassigned

Bug Description

Hi community.

Using OpenERP server version 5.2dev. and trying to create a new project (not filling all fields), I found myself with following error:

[2010-04-08 17:36:01,799] ERROR:web-services:[01]: Traceback (most recent call last):
[2010-04-08 17:36:01,800] ERROR:web-services:[02]: File "/opt/openerp/5.2/openobject-server-trunk/bin/osv/osv.py", line 57, in wrapper
[2010-04-08 17:36:01,800] ERROR:web-services:[03]: return f(self, dbname, *args, **kwargs)
[2010-04-08 17:36:01,800] ERROR:web-services:[04]: File "/opt/openerp/5.2/openobject-server-trunk/bin/osv/osv.py", line 120, in execute
[2010-04-08 17:36:01,800] ERROR:web-services:[05]: res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
[2010-04-08 17:36:01,800] ERROR:web-services:[06]: File "/opt/openerp/5.2/openobject-server-trunk/bin/osv/osv.py", line 110, in execute_cr
[2010-04-08 17:36:01,801] ERROR:web-services:[07]: return getattr(object, method)(cr, uid, *args, **kw)
[2010-04-08 17:36:01,801] ERROR:web-services:[08]: File "/opt/openerp/5.2/openobject-server-trunk/bin/osv/orm.py", line 3072, in create
[2010-04-08 17:36:01,801] ERROR:web-services:[09]: self.pool.get(table).write(cr, user, [record_id], tocreate[table], context=context)
[2010-04-08 17:36:01,801] ERROR:web-services:[10]: File "/opt/openerp/5.2/openobject-server-trunk/bin/osv/orm.py", line 2890, in write
[2010-04-08 17:36:01,801] ERROR:web-services:[11]: cr.execute('SELECT id FROM "'+self._table+'" WHERE id IN ('+ids_str+')')
[2010-04-08 17:36:01,801] ERROR:web-services:[12]: File "/opt/openerp/5.2/openobject-server-trunk/bin/sql_db.py", line 74, in wrapper
[2010-04-08 17:36:01,801] ERROR:web-services:[13]: return f(self, *args, **kwargs)
[2010-04-08 17:36:01,802] ERROR:web-services:[14]: File "/opt/openerp/5.2/openobject-server-trunk/bin/sql_db.py", line 119, in execute
[2010-04-08 17:36:01,802] ERROR:web-services:[15]: res = self._obj.execute(query, params)
[2010-04-08 17:36:01,802] ERROR:web-services:[16]: ProgrammingError: operator does not exist: integer = boolean
[2010-04-08 17:36:01,802] ERROR:web-services:[17]: LÍNEA 1: ...ELECT id FROM "account_analytic_account" WHERE id IN (False)
[2010-04-08 17:36:01,802] ERROR:web-services:[18]: ^
[2010-04-08 17:36:01,802] ERROR:web-services:[19]: SUGERENCIA: No operator matches the given name and argument type(s). You might need to add explicit type casts.

Exploring "orm.py" file in "<server_path>/bin/osv" dir, it seemed that, in "create" method, when collecting all "to_create" record ds it was performed an "if record_id is None:" condition, without checking, for example, that record_id could be False (like mentioned example). In this case, flow entered "else" branch and tried to write an -yet- inexisting id. Considering this, there is a patch attached that replace this condition for "if not bool(record_id):" so both "None" and "False" cases are controlled (because although None != False, bool(None)=bool(False)=False).

Regards.

Related branches

Revision history for this message
Alberto Luengo Cabanillas (Pexego) (alberto-pexego) wrote :
Changed in openobject-server:
milestone: none → 6.0
description: updated
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Fixed by revision 2225 <email address hidden>.
Thanks.

summary: - [TRUNK]Error when creating a new project
+ Error when relational field to _inherits is FALSE!
Changed in openobject-server:
status: New → Confirmed
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.