currency error in analytic account (solved)

Bug #659183 reported by hsm flxCore
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
New
Undecided
Unassigned

Bug Description

I have a problem with 3 machines (at least):
M1: oerpserver 5.0.11 (local instance)
M2: oerpserver 5.0.11 (development server)
M3: oerpserver 5.0.14 (local instance)

1. On M3 I import data (using spreadsheet).
2. I backup the database (using Postgres dump)
3. On M1 I restore the database (using Postgres restore)
4 On M2 I restore the database (using Postgres restore)

Now, on M1 things work as expected. However, on M2 I get an error when displaying an account.analytic.account tree that contains a balance column.

I get the following error:

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/openerp-server/netsvc.py", line 247, in dispatch
    result = LocalService(service_name)(method, *params)
  File "/usr/lib/python2.5/site-packages/openerp-server/netsvc.py", line 76, in __call__
    return getattr(self, method)(*params)
  File "/usr/lib/python2.5/site-packages/openerp-server/addons/base_module_record/base_module_record.py", line 38, in execute
    res = super(recording_objects_proxy, self).execute(*args, **argv)
  File "/usr/lib/python2.5/site-packages/openerp-server/service/web_services.py", line 577, in execute
    res = service.execute(db, uid, object, method, *args)
  File "/usr/lib/python2.5/site-packages/openerp-server/osv/osv.py", line 58, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/openerp-server/osv/osv.py", line 119, in execute
    res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/lib/python2.5/site-packages/openerp-server/osv/osv.py", line 111, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/lib/python2.5/site-packages/openerp-server/osv/orm.py", line 2228, in read
    result = self._read_flat(cr, user, select, fields, context, load)
  File "/usr/lib/python2.5/site-packages/openerp-server/osv/orm.py", line 2360, in _read_flat
    res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
  File "/usr/lib/python2.5/site-packages/openerp-server/osv/fields.py", line 659, in get
    res = self._fnct(obj, cr, user, ids, name, self._arg, context)
  File "/usr/lib/python2.5/site-packages/openerp-server/addons/account/project/project.py", line 133, in _balance_calc
    if currency[child]<>currency[id]:
KeyError: 103

The most obvious reason would be that M3 handles things differently (for example the import of data). But the M1 machine still works..
Furthermore the M2 machine works correctly without the imported data (clean install with same set of modules).

Maybe you have an idea what may be the reason, and why it is so specific.

Thanks in advance!

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Hannes,

We have fixed it in 5.0.12.

Please get the code/version updated or apply the patch as given here :
http://bazaar.launchpad.net/~openerp/openobject-addons/5.0/revision/2752

If I remember correctly, you already had applied patch earlier.

Thanks.

Changed in openobject-addons:
milestone: none → 5.0.15
Revision history for this message
hsm flxCore (hannes-smit) wrote :

Thanks Jay,
But I think this is not the reason: on M1 things still work.
Can you explain what the fix was? I cannot open the link you attached.

Revision history for this message
hsm flxCore (hannes-smit) wrote :

Allright.. I understand things now, now I have seen the patch you (Jay) were referring too.

For the sake of clarity: I patched M1 before! Sorry guys!

Revision history for this message
hsm flxCore (hannes-smit) wrote :
Download full text (4.1 KiB)

Can this error report be related? Its the same ids2, although in another module:

/home/openerp/OpenERP/5.0/server/bin/tools/misc.py:750: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  if hasattr(e, 'message'):
/home/openerp/OpenERP/5.0/server/bin/tools/misc.py:751: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  return ustr(e.message)
bzr: ERROR: Not a branch: "/home/openerp/".
No LSB modules are available.
[2010-10-26 11:11:55,194] ERROR:web-services:[01]:
[2010-10-26 11:11:55,201] ERROR:web-services:[02]: Environment Information :
[2010-10-26 11:11:55,202] ERROR:web-services:[03]: System : Linux-2.6.32-22-generic-x86_64-with-Ubuntu-10.04-lucid
[2010-10-26 11:11:55,202] ERROR:web-services:[04]: OS Name : posix
[2010-10-26 11:11:55,202] ERROR:web-services:[05]: Distributor ID: Ubuntu
[2010-10-26 11:11:55,203] ERROR:web-services:[06]: Description: Ubuntu 10.04 LTS
[2010-10-26 11:11:55,203] ERROR:web-services:[07]: Release: 10.04
[2010-10-26 11:11:55,203] ERROR:web-services:[08]: Codename: lucid
[2010-10-26 11:11:55,203] ERROR:web-services:[09]: Operating System Release : 2.6.32-22-generic
[2010-10-26 11:11:55,204] ERROR:web-services:[10]: Operating System Version : #36-Ubuntu SMP Thu Jun 3 19:31:57 UTC 2010
[2010-10-26 11:11:55,204] ERROR:web-services:[11]: Operating System Architecture : 64bit
[2010-10-26 11:11:55,204] ERROR:web-services:[12]: Operating System Locale : en_US.UTF8
[2010-10-26 11:11:55,208] ERROR:web-services:[13]: Python Version : 2.6.5
[2010-10-26 11:11:55,208] ERROR:web-services:[14]: OpenERP-Server Version : 5.0.11
[2010-10-26 11:11:55,209] ERROR:web-services:[15]: Last revision No. & ID :
[2010-10-26 11:11:55,209] ERROR:web-services:[16]: Traceback (most recent call last):
[2010-10-26 11:11:55,209] ERROR:web-services:[17]: File "/home/openerp/OpenERP/5.0/server/bin/osv/osv.py", line 58, in wrapper
[2010-10-26 11:11:55,210] ERROR:web-services:[18]: return f(self, dbname, *args, **kwargs)
[2010-10-26 11:11:55,210] ERROR:web-services:[19]: File "/home/openerp/OpenERP/5.0/server/bin/osv/osv.py", line 119, in execute
[2010-10-26 11:11:55,210] ERROR:web-services:[20]: res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
[2010-10-26 11:11:55,211] ERROR:web-services:[21]: File "/home/openerp/OpenERP/5.0/server/bin/osv/osv.py", line 111, in execute_cr
[2010-10-26 11:11:55,211] ERROR:web-services:[22]: return getattr(object, method)(cr, uid, *args, **kw)
[2010-10-26 11:11:55,211] ERROR:web-services:[23]: File "/home/openerp/OpenERP/5.0/server/bin/osv/orm.py", line 2228, in read
[2010-10-26 11:11:55,212] ERROR:web-services:[24]: result = self._read_flat(cr, user, select, fields, context, load)
[2010-10-26 11:11:55,212] ERROR:web-services:[25]: File "/home/openerp/OpenERP/5.0/server/bin/osv/orm.py", line 2360, in _read_flat
[2010-10-26 11:11:55,212] ERROR:web-services:[26]: res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
[2010-10-26 11:11:55,212] ERROR:web-services:[27]: File "/home/openerp/OpenERP/5.0/server/bin/osv/fields.py", line 659, in get
[2010-10-26 11:11:55,213] ERROR:web-services:[28]: ...

Read more...

Revision history for this message
hsm flxCore (hannes-smit) wrote :

Postgres says: (the clock is wrong... not sure, but I think it is the same error)

2010-10-26 11:11:53 CEST ERROR: integer out of range
2010-10-26 11:11:53 CEST STATEMENT: SELECT DISTINCT(month_id) FROM account_analytic_analysis_summary_month WHERE account_id in (13030,13032,13031) AND unit_amount <> 0.0

Revision history for this message
hsm flxCore (hannes-smit) wrote :

We found out that the problem was indeed in the account analytic analysis module. It tries to find month summaries. By the way, this has a huge performance impact. Even when displaying a tree of account analytic accounts, all month summaries are calculated (so it seems).
But that's worth another topic.

summary: - currency error in analytic account
+ currency error in analytic account (solved)
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

File another bug report please.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.