account/project/project.py KeyError on currency[child]
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Steps to reproduce:
* Create 2 analytical accounts
* Link parent_id of one account to other
* Try to open parent account in form view.
Error received :
No LSB modules are available.
ERROR:common.
Environment Information :
System : Linux-2.
OS Name : posix
Distributor ID: Ubuntu
Description: Ubuntu 10.04.1 LTS
Release: 10.04
Codename: lucid
Operating System Release : 2.6.32-24-generic
Operating System Version : #38-Ubuntu SMP Mon Jul 5 09:20:59 UTC 2010
Operating System Architecture : 64bit
Operating System Locale : en_US.UTF8
Python Version : 2.6.5
OpenERP-Client Version : 5.0.11
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
File "/home/
result = LocalService(
File "/home/
return getattr(self, method)(*params)
File "/home/
res = service.execute(db, uid, object, method, *args)
File "/home/
return f(self, dbname, *args, **kwargs)
File "/home/
res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
File "/home/
return getattr(object, method)(cr, uid, *args, **kw)
File "/home/
result = self._read_flat(cr, user, select, fields, context, load)
File "/home/
res2 = self._columns[
File "/home/
res = self._fnct(obj, cr, user, ids, name, self._arg, context)
File "/home/
if currency[
KeyError: 8
The '8' signifies the id of the child analytical account.
The problem lies in this code :
=== modified file 'addons/
--- a/addons/
+++ b/addons/
@@ -117,7 +117,7 @@
- "WHERE a.id in %s", (tuple(ids),))
+ "WHERE a.id in %s", (tuple(ids2),))
currency = dict(cr.fetchall())
ids2 contains the id's of the child accounts of the account currently being loaded.
When the list is viewed there is no problem because as it happens the child account is also in the ids (if it's on the same page)
but on the form view the currency_id of the child account is not retrieved thus triggering a KeyError exception.
Annotate shows revision 2620.1.16 as the faulty commit.
A fix is provided in revision 2752.
Just reporting this bug so you can track this for releaselog for 5.0.13.
Please link to milestone 5.0.13 and mark Fix Commited (when release of 5.0.13 is there you can just look at launchpad for all the Fix Commited bugs with milestone 5.0.13 and you have your changelog)