c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #03919
[Bug 673447] Re: Server ORM bug when using calculated field, error of syntax
Thank you Jay for applying the patch.
I have a "non technical" suggestion that I think is important : next
time, could you mention the author of the patch in the commit message ?
For example, you could say in the commit message :
[FIX] Auto_init : correction for store functionality of an _inherits field
Patch courtesy of Sébastien Beau.
This practise is very common among free software projects ; patch
authors are proud to see their name in the commit message, and it's a
motivation for them to continue to write good patches.
For example, in the VideoLAN project, everytime a patch written by
someone who doesn't have commit rights is commited by a developer with
commit rights, the commit message contains the name of the author of the
patch. For exemple, search for "patch" in this changelog (which is an
aggregation of commit messages) :
http://www.videolan.org/developers/libdvdcss/ChangeLog.html
and you see that they never forget to mention the name of the author of
the patch in the commit message.
--
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