fields.py : correction on get() of O2M
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) | Status tracked in Trunk | |||||
5.0 |
Fix Released
|
Undecided
|
Unassigned | |||
Trunk |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Hello
Maybe it's a server bug.
After installing Fleet Maintenance on a fresh installation.
I can't open the partner view if the field sub fleet of the partner is empty. (on a fresh install all partner have this field empty)
[2010-07-09 19:39:43,617] ERROR:web-
[2010-07-09 19:39:43,617] ERROR:web-
[2010-07-09 19:39:43,618] ERROR:web-
[2010-07-09 19:39:43,618] ERROR:web-
[2010-07-09 19:39:43,618] ERROR:web-
[2010-07-09 19:39:43,619] ERROR:web-
[2010-07-09 19:39:43,619] ERROR:web-
[2010-07-09 19:39:43,619] ERROR:web-
[2010-07-09 19:39:43,620] ERROR:web-
[2010-07-09 19:39:43,620] ERROR:web-
[2010-07-09 19:39:43,620] ERROR:web-
[2010-07-09 19:39:43,620] ERROR:web-
[2010-07-09 19:39:43,620] ERROR:web-
[2010-07-09 19:39:43,621] ERROR:web-
[2010-07-09 19:39:43,621] ERROR:web-
[2010-07-09 19:39:43,621] ERROR:web-
[2010-07-09 19:39:43,622] ERROR:web-
[2010-07-09 19:39:43,622] ERROR:web-
[2010-07-09 19:39:43,622] ERROR:web-
[2010-07-09 19:39:43,622] ERROR:web-
[2010-07-09 19:39:43,623] ERROR:web-
[2010-07-09 19:39:43,623] ERROR:web-
[2010-07-09 19:39:43,623] ERROR:web-
[2010-07-09 19:39:43,623] ERROR:web-
[2010-07-09 19:39:43,624] ERROR:web-
[2010-07-09 19:39:43,624] ERROR:web-
[2010-07-09 19:39:43,624] ERROR:web-
[2010-07-09 19:39:43,624] ERROR:web-
[2010-07-09 19:39:43,625] ERROR:web-
[2010-07-09 19:39:43,625] ERROR:web-
If you look in the server code function def get line 427
you can saw that we try to update the dictionary res but in my case the key "r[self.
==CODE==
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None):
if not context:
context = {}
if self._context:
context = context.copy()
if not values:
values = {}
res = {}
for id in ids:
res[id] = []
ids2 = obj.pool.
for r in obj.pool.
return res
==CODE==
If you check the function def get_memory line 379 we check if this key exist before
==CODE==
def get_memory(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None):
if not context:
context = {}
if self._context:
context = context.copy()
if not values:
values = {}
res = {}
for id in ids:
res[id] = []
ids2 = obj.pool.
for r in obj.pool.
if r[self._fields_id] in res:
return res
==CODE==
I think we have to check also in the function def get and I propose this patch.
Expert team in ORM what do you think about this?
Best regard
Changed in openobject-addons: | |
status: | New → Confirmed |
Changed in openobject-addons: | |
assignee: | nobody → RME(OpenERP) (rme-openerp) |
Is there a good reason not to merge the patch proposed by Sébastien ?
We are also affected by this bug, which prevent us from upgrading OpenERP to the latest stable 5.0.x versions.