c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #00037
[Bug 603708] Re: [server][fleet maintenance] BUG when opening the partner menu
Sorry, as you can look in my first patch a ugly "if True" appear in the first line "if True : #r[self._fields_id] in res:". Just remove it (It was for testing).
Here is the patch without the "if True"
** Patch added: "server.patch"
https://bugs.launchpad.net/openobject-addons/+bug/603708/+attachment/1689476/+files/server.patch
--
[server][fleet maintenance] BUG when opening the partner menu
https://bugs.launchpad.net/bugs/603708
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP OpenObject.
Status in OpenObject Addons Modules: Confirmed
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-services:[01]:
[2010-07-09 19:39:43,617] ERROR:web-services:[02]: Environment Information :
[2010-07-09 19:39:43,618] ERROR:web-services:[03]: System : Linux-2.6.32-23-generic-x86_64-with-Ubuntu-10.04-lucid
[2010-07-09 19:39:43,618] ERROR:web-services:[04]: OS Name : posix
[2010-07-09 19:39:43,618] ERROR:web-services:[05]: Distributor ID: Ubuntu
[2010-07-09 19:39:43,619] ERROR:web-services:[06]: Description: Ubuntu 10.04 LTS
[2010-07-09 19:39:43,619] ERROR:web-services:[07]: Release: 10.04
[2010-07-09 19:39:43,619] ERROR:web-services:[08]: Codename: lucid
[2010-07-09 19:39:43,620] ERROR:web-services:[09]: Operating System Release : 2.6.32-23-generic
[2010-07-09 19:39:43,620] ERROR:web-services:[10]: Operating System Version : #37-Ubuntu SMP Fri Jun 11 08:03:28 UTC 2010
[2010-07-09 19:39:43,620] ERROR:web-services:[11]: Operating System Architecture : 64bit
[2010-07-09 19:39:43,620] ERROR:web-services:[12]: Operating System Locale : fr_FR.UTF8
[2010-07-09 19:39:43,620] ERROR:web-services:[13]: Python Version : 2.6.5
[2010-07-09 19:39:43,621] ERROR:web-services:[14]: OpenERP-Server Version : 5.0.11
[2010-07-09 19:39:43,621] ERROR:web-services:[15]: Last revision No. & ID : 2083 jvo@xxxxxxxxxxx-20100707121350-kvx5mc3bboep82ai
[2010-07-09 19:39:43,621] ERROR:web-services:[16]:
[2010-07-09 19:39:43,622] ERROR:web-services:[17]: Traceback (most recent call last):
[2010-07-09 19:39:43,622] ERROR:web-services:[18]: File "/media/Mes_doc/DEV/openerp/ticket_anevia_fleet_250/server/bin/osv/osv.py", line 58, in wrapper
[2010-07-09 19:39:43,622] ERROR:web-services:[19]: return f(self, dbname, *args, **kwargs)
[2010-07-09 19:39:43,622] ERROR:web-services:[20]: File "/media/Mes_doc/DEV/openerp/ticket_anevia_fleet_250/server/bin/osv/osv.py", line 119, in execute
[2010-07-09 19:39:43,623] ERROR:web-services:[21]: res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
[2010-07-09 19:39:43,623] ERROR:web-services:[22]: File "/media/Mes_doc/DEV/openerp/ticket_anevia_fleet_250/server/bin/osv/osv.py", line 111, in execute_cr
[2010-07-09 19:39:43,623] ERROR:web-services:[23]: return getattr(object, method)(cr, uid, *args, **kw)
[2010-07-09 19:39:43,623] ERROR:web-services:[24]: File "/media/Mes_doc/DEV/openerp/ticket_anevia_fleet_250/server/bin/osv/orm.py", line 2228, in read
[2010-07-09 19:39:43,624] ERROR:web-services:[25]: result = self._read_flat(cr, user, select, fields, context, load)
[2010-07-09 19:39:43,624] ERROR:web-services:[26]: File "/media/Mes_doc/DEV/openerp/ticket_anevia_fleet_250/server/bin/osv/orm.py", line 2360, in _read_flat
[2010-07-09 19:39:43,624] ERROR:web-services:[27]: res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
[2010-07-09 19:39:43,624] ERROR:web-services:[28]: File "/media/Mes_doc/DEV/openerp/ticket_anevia_fleet_250/server/bin/osv/fields.py", line 428, in get
[2010-07-09 19:39:43,625] ERROR:web-services:[29]: res[r[self._fields_id]].append(r['id'])
[2010-07-09 19:39:43,625] ERROR:web-services:[30]: KeyError: None
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._fields_id]" don't exist in res
==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()
context.update(self._context)
if not values:
values = {}
res = {}
for id in ids:
res[id] = []
ids2 = obj.pool.get(self._obj).search(cr, user, [(self._fields_id, 'in', ids)], limit=self._limit, context=context)
for r in obj.pool.get(self._obj)._read_flat(cr, user, ids2, [self._fields_id], context=context, load='_classic_write'):
res[r[self._fields_id]].append(r['id']) <=== HERE ==========================
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()
context.update(self._context)
if not values:
values = {}
res = {}
for id in ids:
res[id] = []
ids2 = obj.pool.get(self._obj).search(cr, user, [(self._fields_id, 'in', ids)], limit=self._limit, context=context)
for r in obj.pool.get(self._obj).read(cr, user, ids2, [self._fields_id], context=context, load='_classic_write'):
if r[self._fields_id] in res:
res[r[self._fields_id]].append(r['id']) <=== HERE ==========================
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