Analytic Chart of Accounts not displaying

Bug #592005 reported by Mark Guthart
32
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Undecided
Dhara Shah (OpenERP)

Bug Description

In version 5.0.11, was creating new Analytic Accounts with no problems. As long as there were no 'child' analytic accounts, the Analytic Chart of Accounts displayed things fine. Once I added a 'child' analytic account, the Analytic Chart of Accounts no longer displayed the Account Code, Account Name, Date End, or Currency information. (There are no entries against these accounts - am just in the process of setting them up).

No messsages appear on the client side, but the following appears on the server side (running both the client and server through a terminal to catch any messages). Also note that I am running the regular, GTK client, and not the web client (I don't even have the web client installed in this environment):

sh: bzr: not found
No LSB modules are available.
[2010-06-09 21:51:44,734] ERROR:web-services:[01]:
[2010-06-09 21:51:44,734] ERROR:web-services:[02]: Environment Information :
[2010-06-09 21:51:44,734] ERROR:web-services:[03]: System : Linux-2.6.32-22-server-x86_64-with-Ubuntu-10.04-lucid
[2010-06-09 21:51:44,735] ERROR:web-services:[04]: OS Name : posix
[2010-06-09 21:51:44,735] ERROR:web-services:[05]: Distributor ID: Ubuntu
[2010-06-09 21:51:44,735] ERROR:web-services:[06]: Description: Ubuntu 10.04 LTS
[2010-06-09 21:51:44,735] ERROR:web-services:[07]: Release: 10.04
[2010-06-09 21:51:44,735] ERROR:web-services:[08]: Codename: lucid
[2010-06-09 21:51:44,735] ERROR:web-services:[09]: Operating System Release : 2.6.32-22-server
[2010-06-09 21:51:44,735] ERROR:web-services:[10]: Operating System Version : #36-Ubuntu SMP Thu Jun 3 20:38:33 UTC 2010
[2010-06-09 21:51:44,735] ERROR:web-services:[11]: Operating System Architecture : 64bit
[2010-06-09 21:51:44,735] ERROR:web-services:[12]: Operating System Locale : en_US.UTF8
[2010-06-09 21:51:44,735] ERROR:web-services:[13]: Python Version : 2.6.5
[2010-06-09 21:51:44,735] ERROR:web-services:[14]: OpenERP-Server Version : 5.0.11
[2010-06-09 21:51:44,735] ERROR:web-services:[15]: Last revision No. & ID :
[2010-06-09 21:51:44,736] ERROR:web-services:[16]: Traceback (most recent call last):
[2010-06-09 21:51:44,736] ERROR:web-services:[17]: File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 58, in wrapper
[2010-06-09 21:51:44,736] ERROR:web-services:[18]: return f(self, dbname, *args, **kwargs)
[2010-06-09 21:51:44,736] ERROR:web-services:[19]: File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 119, in execute
[2010-06-09 21:51:44,736] ERROR:web-services:[20]: res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
[2010-06-09 21:51:44,736] ERROR:web-services:[21]: File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 111, in execute_cr
[2010-06-09 21:51:44,736] ERROR:web-services:[22]: return getattr(object, method)(cr, uid, *args, **kw)
[2010-06-09 21:51:44,736] ERROR:web-services:[23]: File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/orm.py", line 2228, in read
[2010-06-09 21:51:44,736] ERROR:web-services:[24]: result = self._read_flat(cr, user, select, fields, context, load)
[2010-06-09 21:51:44,736] ERROR:web-services:[25]: File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/orm.py", line 2360, in _read_flat
[2010-06-09 21:51:44,736] ERROR:web-services:[26]: res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
[2010-06-09 21:51:44,736] ERROR:web-services:[27]: File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/fields.py", line 659, in get
[2010-06-09 21:51:44,736] ERROR:web-services:[28]: res = self._fnct(obj, cr, user, ids, name, self._arg, context)
[2010-06-09 21:51:44,737] ERROR:web-services:[29]: File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/account/project/project.py", line 133, in _balance_calc
[2010-06-09 21:51:44,737] ERROR:web-services:[30]: if currency[child]<>currency[id]:
[2010-06-09 21:51:44,737] ERROR:web-services:[31]: KeyError: 10

Revision history for this message
Open Net Sàrl (openerp-open-net) wrote :

Hi

We have the same problem.

My guess is that in the file: /usr/lib/python2.5/site-packages/openerp-server/addons/account/project/project.py, @ line 117-120, one can read:
        cr.execute("SELECT a.id, r.currency_id "
                   "FROM account_analytic_account a "
                   "INNER JOIN res_company r ON (a.company_id = r.id) "
                   "WHERE a.id in %s", (tuple(ids),))

My proposition is that the query should use "tuple(ids2)" instead of "tuple(ids)", because "ids2" contains the children of "ids"

affects: openobject-server → openobject-addons
Changed in openobject-addons:
assignee: nobody → dsh (Open ERP) (dsh-openerp)
status: New → Fix Released
milestone: none → 5.0.12
Revision history for this message
marcosambo (marco-sambo) wrote :

Hi,
I have the same problem.
But I don't understand what can I do to resolve this problem.
Can you help me Jay?

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

Hello Marco,

You need to update the code from Launchpad : https://code.launchpad.net/~openerp/openobject-addons/5.0

Else, apply the patch from here : http://bazaar.launchpad.net/~openerp/openobject-addons/5.0/revision/2752

Hope this helps.

Thanks.

Revision history for this message
marcosambo (marco-sambo) wrote :

Thank you Jay,
To update the code from launchpad, I have to update all single module that I have installed into my installation?
And to apply patch, I have to substitute account/project/project.py in my installed module with the patched ones?

Thank you again

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

Hi Marco,

You may simply replace the whole file from http://bazaar.launchpad.net/~openerp/openobject-addons/5.0/annotate/head:/account/project/project.py.

Else, Look at the link http://bazaar.launchpad.net/~openerp/openobject-addons/5.0/revision/2752; you can change the 2 lines and you will get it working.

Thanks.

Revision history for this message
marcosambo (marco-sambo) wrote :

Ok, thank you very much. It works!!!
Thanks.

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

Thanks Jay fo the fast response yesterday. I copied the project.py code into my own project.py code. Yesterday everything worked fine.
But today, after restarting I guess, I get an error, telling me the project task does not exist.
I tried my old databases and created a new one, both are not working. The error:

Environment Information :
System : Linux-2.6.32-22-generic-x86_64-with-Ubuntu-10.04-lucid
OS Name : posix
Distributor ID: Ubuntu
Description: Ubuntu 10.04 LTS
Release: 10.04
Codename: lucid
Operating System Release : 2.6.32-22-generic
Operating System Version : #36-Ubuntu SMP Thu Jun 3 19:31:57 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/openerp/OpenERP/5.0/server/bin/netsvc.py", line 247, in dispatch
    result = LocalService(service_name)(method, *params)
  File "/home/openerp/OpenERP/5.0/server/bin/netsvc.py", line 76, in __call__
    return getattr(self, method)(*params)
  File "/home/openerp/OpenERP/5.0/server/bin/service/web_services.py", line 633, in execute
    return self._execute(db, uid, wiz_id, datas, action, context)
  File "/home/openerp/OpenERP/5.0/server/bin/service/web_services.py", line 613, in _execute
    return wiz.execute(db, uid, self.wiz_datas[wiz_id], action, context)
  File "/home/openerp/OpenERP/5.0/server/bin/wizard/__init__.py", line 178, in execute
    res = self.execute_cr(cr, uid, data, state, context)
  File "/home/openerp/OpenERP/5.0/server/bin/wizard/__init__.py", line 73, in execute_cr
    action_res = action(self, cr, uid, data, context)
  File "/home/openerp/OpenERP/5.0/server/bin/addons/base_setup/wizard/wizard_base_setup.py", line 208, in _update
    (db, pool)=pooler.restart_pool(cr.dbname, update_module=True)
  File "/home/openerp/OpenERP/5.0/server/bin/pooler.py", line 62, in restart_pool
    return get_db_and_pool(db_name, force_demo, status, update_module=update_module)
  File "/home/openerp/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/openerp/OpenERP/5.0/server/bin/addons/__init__.py", line 741, in load_modules
    r = load_module_graph(cr, graph, status, report=report)
  File "/home/openerp/OpenERP/5.0/server/bin/addons/__init__.py", line 584, in load_module_graph
    init_module_objects(cr, package.name, modules)
  File "/home/openerp/OpenERP/5.0/server/bin/addons/__init__.py", line 373, in init_module_objects
    obj.init(cr)
  File "/home/openerp/OpenERP/5.0/server/bin/addons/report_task/report_task.py", line 59, in init
    ''')
  File "/home/openerp/OpenERP/5.0/server/bin/sql_db.py", line 77, in wrapper
    return f(self, *args, **kwargs)
  File "/home/openerp/OpenERP/5.0/server/bin/sql_db.py", line 122, in execute
    res = self._obj.execute(query, params)
ProgrammingError: relation "project_task" does not exist
LINE 14: project_task t on (u.id = t.user_id)
                             ^

Hannes

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

Hi Hannes,

I fear that you copied a wrong file.
Please follow comment #5 on this thread.

The file is account/project/project.py , not project/project.py.

Thanks.

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

Ah.. Thanks Jay!

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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