accounts pagination bug

Bug #1217707 reported by Ajit
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Invalid
Undecided
Unassigned

Bug Description

When you have many accounts so that a child account belongs to the next page where the parent account is currently showed you get a KeyError:

[code]
Client Traceback (most recent call last):
  File "C:\Program Files (x86)\OpenERP 7.0-20130825-231127\Server\server\openerp\addons\web\http.py", line 204, in dispatch
  File "C:\Program Files (x86)\OpenERP 7.0-20130825-231127\Server\server\openerp\addons\web\controllers\main.py", line 1054, in search_read
  File "C:\Program Files (x86)\OpenERP 7.0-20130825-231127\Server\server\openerp\addons\web\controllers\main.py", line 1089, in do_search_read
  File "C:\Program Files (x86)\OpenERP 7.0-20130825-231127\Server\server\openerp\addons\web\session.py", line 42, in proxy
  File "C:\Program Files (x86)\OpenERP 7.0-20130825-231127\Server\server\openerp\addons\web\session.py", line 30, in proxy_method
  File "C:\Program Files (x86)\OpenERP 7.0-20130825-231127\Server\server\openerp\addons\web\session.py", line 103, in send

Server Traceback (most recent call last):
  File "C:\Program Files (x86)\OpenERP 7.0-20130825-231127\Server\server\openerp\addons\web\session.py", line 89, in send
  File "C:\Program Files (x86)\OpenERP 7.0-20130825-231127\Server\server\.\openerp\netsvc.py", line 292, in dispatch_rpc
  File "C:\Program Files (x86)\OpenERP 7.0-20130825-231127\Server\server\.\openerp\service\web_services.py", line 626, in dispatch
  File "C:\Program Files (x86)\OpenERP 7.0-20130825-231127\Server\server\.\openerp\osv\osv.py", line 188, in execute_kw
  File "C:\Program Files (x86)\OpenERP 7.0-20130825-231127\Server\server\.\openerp\osv\osv.py", line 131, in wrapper
  File "C:\Program Files (x86)\OpenERP 7.0-20130825-231127\Server\server\.\openerp\osv\osv.py", line 197, in execute
  File "C:\Program Files (x86)\OpenERP 7.0-20130825-231127\Server\server\.\openerp\osv\osv.py", line 185, in execute_cr
  File "C:\Program Files (x86)\OpenERP 7.0-20130825-231127\Server\server\.\openerp\osv\orm.py", line 3606, in read
  File "C:\Program Files (x86)\OpenERP 7.0-20130825-231127\Server\server\.\openerp\osv\orm.py", line 3714, in _read_flat
  File "C:\Program Files (x86)\OpenERP 7.0-20130825-231127\Server\server\.\openerp\osv\fields.py", line 1133, in get
  File "C:\Program Files (x86)\OpenERP 7.0-20130825-231127\Server\server\openerp\addons\account\account.py", line 348, in __compute
KeyError: 401
[/code]

Steps to reproduce:
insert more then 80 accounts
set the 80+1 account as child of a smaller-code account
load the first page (1 - 80) of accounts

Result expected:
no error

Browser:
Google Chrome 29.0.1547.57 m

OpenERP version:
OpenERP 7.0-20130825-231127

OS:
Win7

Amit Parik (amit-parik)
affects: openobject-client-web → openobject-addons
Revision history for this message
Twinkle Christian(OpenERP) (tch-openerp) wrote :

Hello Ajit,

I have checked this issue with latest build of 7.0 :

   (Build 19775)
    server (5074)
    addons (9432)
    web (4027)

on Chrome Version 29.0.1547.65, But its working fine at all. So, Would you please check it again and correct me if I did any wrong.

Thanks.

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Ajit (alessandro-domanico) wrote :

Hello Christian,

I don't know where to find build numbers for all components. What can I add as information is the accounting module version:

account_accountant
version:7.0.1.1

I can still reproduce the error but I'm working with a patched version of account.py:
[line 346]
                        try:
                            if child.company_id.currency_id.id == current.company_id.currency_id.id:
                                sums[current.id][fn] += sums[child.id][fn]
                            else:
                                sums[current.id][fn] += currency_obj.compute(cr, uid, child.company_id.currency_id.id, current.company_id.currency_id.id, sums[child.id][fn], context=context)
                        except KeyError:
                         pass
[...]

Revision history for this message
Twinkle Christian(OpenERP) (tch-openerp) wrote :

Hello Ajit,

I have checked this issue with above patch also, but still I am not facing any traceback. So, would you please check it with latest and notify us about this issue.

And also, have you customize your code? because from our side with latest V7, its working fine. So, Currently I am closing this issue , but if in future, if you still have this issue then you can reopen it with more evidence.

Thank you.

Changed in openobject-addons:
status: Incomplete → Invalid
Revision history for this message
Ajit (alessandro-domanico) wrote :

Hello Chris, sure you cannot get the error with the patch because it bypass the problem. I've attached it just to highlight the code where the error occurs.

Anyway, thanks for your support. I will try to reproduce it again with more detailed steps.

Revision history for this message
Ajit (alessandro-domanico) wrote :

Hello Chris! I found where was the problem! I comment here in case it may helps somebody else.

I found that parent_left and parent_right column in account_account table were populated with wrong values which were not reflecting correctly my accounts structure, so also some reports (like Balance Sheet) were wrongly formatted (with some accounts belonging to wrong parents).

I fixed it with:
alter table account_account drop parent_left;
alter table account_account drop parent_right;
and restart the server with –update=account on the same db

Now everything is working fine.

Tip: I don't know why parent_left and parent_right were containing wrong values, could be a OpenERP error when adding new accounts?

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.