← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 673447] Re: Server ORM bug when using calculated field, error of syntax

 

Fixed by revision 2152 jvo@xxxxxxxxxxx-20101111102842-llf920q8sog0z9fi.
Thanks.

** Changed in: openobject-server
       Status: Confirmed => Fix Released

-- 
Server ORM bug when using calculated field, error of syntax
https://bugs.launchpad.net/bugs/673447
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: Fix Released

Bug description:
Hi I found a bug in the ORM. It's an error of syntax!

line 2011 of orm.py
if (not isinstance(self._columns[record[1]],fields.function)) or (record[1] in self._inherit_fields and not isinstance(self._inherit_fields[[record[1]]][2],fields.function)):

The error is at the end of the line self._inherit_fields[[record[1]]], you give a list as key of the dictionary.
Just remove the two useless Square brackets and It's work perfectly.

I send you a patch

For information this code was removed on version 6. 

Traceback (most recent call last):
  File "./openerp-server.py", line 103, in <module>
    pooler.get_db_and_pool(db, update_module=tools.config['init'] or tools.config['update'])
  File "/home/sebastien/DEV/openerp/5.0/server/bin/pooler.py", line 40, in get_db_and_pool
    addons.load_modules(db, force_demo, status, update_module)
  File "/home/sebastien/DEV/openerp/5.0/server/bin/addons/__init__.py", line 736, in load_modules
    r = load_module_graph(cr, graph, status, report=report)
  File "/home/sebastien/DEV/openerp/5.0/server/bin/addons/__init__.py", line 579, in load_module_graph
    init_module_objects(cr, package.name, modules)
  File "/home/sebastien/DEV/openerp/5.0/server/bin/addons/__init__.py", line 362, in init_module_objects
    result = obj._auto_init(cr, {'module': module_name})
  File "/home/sebastien/DEV/openerp/5.0/server/bin/osv/orm.py", line 2011, in _auto_init
    if (not isinstance(self._columns[record[1]],fields.function)) or (record[1] in self._inherit_fields and not isinstance(self._inherit_fields[[record[1]]][2],fields.function)):
TypeError: unhashable type: 'list'





References