← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 716965] [NEW] After duplicating account then error occured in __compute method on account.account object

 

Public bug reported:

I'm using v6.0.1 on Ubuntu 10.04

I duplicated an account then getting errors:

 File "openerp-server/netsvc.py", line 489, in dispatch
    result = ExportService.getService(service_name).dispatch(method, auth, params)
  File "openerp-server/service/web_services.py", line 599, in dispatch
    res = fn(db, uid, *params)
  File "openerp-server/addons/audittrail/audittrail.py", line 511, in execute
    res = my_fct(db, uid, model, method, *args)
  File "openerp-server/addons/audittrail/audittrail.py", line 495, in my_fct
    return fct_src(db, uid, model, method, *args)
  File "openerp-server/osv/osv.py", line 122, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "openerp-server/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "openerp-server/osv/osv.py", line 167, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "openerp-server/osv/orm.py", line 2921, in read
    result = self._read_flat(cr, user, select, fields, context, load)
  File "openerp-server/osv/orm.py", line 3032, in _read_flat
    res2 = self._columns[val[0]].get(cr, self, ids, val, user, context=context, values=res)
  File "openerp-server/osv/fields.py", line 793, in get
    res = self._fnct(obj, cr, user, ids, name, self._arg, context)
  File "openerp-server/addons/account/account.py", line 306, in __compute
    sums[current.id][fn] += sums[child.id][fn]
KeyError: 454


--------------

on account/account.py line 285 
children_and_consolidated.reverse()
print 'children_and_consolidated :', children_and_consolidated

OUTPUT:
children_and_consolidated : [435, 434, 433, 432, 431, 430, 429, 428, 427, 426, 425, 424, 423, 422, 421, 420, 419, 418, 417, 416, 415, 414, 413, 412, 411, 410, 409, 408, 407, 406, 405, 404, 403, 402, 401, 400, 399, 398, 397, 396, 395, 394, 393, 322, .
. . .

31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14,
453, 455, 13, 454, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]

value 454 is here. But wrong position.

** Affects: openobject-addons
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/716965

Title:
  After duplicating account then error occured in __compute method on
  account.account object

Status in OpenERP Modules (addons):
  New

Bug description:
  I'm using v6.0.1 on Ubuntu 10.04

  I duplicated an account then getting errors:

   File "openerp-server/netsvc.py", line 489, in dispatch
      result = ExportService.getService(service_name).dispatch(method, auth, params)
    File "openerp-server/service/web_services.py", line 599, in dispatch
      res = fn(db, uid, *params)
    File "openerp-server/addons/audittrail/audittrail.py", line 511, in execute
      res = my_fct(db, uid, model, method, *args)
    File "openerp-server/addons/audittrail/audittrail.py", line 495, in my_fct
      return fct_src(db, uid, model, method, *args)
    File "openerp-server/osv/osv.py", line 122, in wrapper
      return f(self, dbname, *args, **kwargs)
    File "openerp-server/osv/osv.py", line 176, in execute
      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
    File "openerp-server/osv/osv.py", line 167, in execute_cr
      return getattr(object, method)(cr, uid, *args, **kw)
    File "openerp-server/osv/orm.py", line 2921, in read
      result = self._read_flat(cr, user, select, fields, context, load)
    File "openerp-server/osv/orm.py", line 3032, in _read_flat
      res2 = self._columns[val[0]].get(cr, self, ids, val, user, context=context, values=res)
    File "openerp-server/osv/fields.py", line 793, in get
      res = self._fnct(obj, cr, user, ids, name, self._arg, context)
    File "openerp-server/addons/account/account.py", line 306, in __compute
      sums[current.id][fn] += sums[child.id][fn]
  KeyError: 454

  
  --------------

  on account/account.py line 285 
  children_and_consolidated.reverse()
  print 'children_and_consolidated :', children_and_consolidated

  OUTPUT:
  children_and_consolidated : [435, 434, 433, 432, 431, 430, 429, 428, 427, 426, 425, 424, 423, 422, 421, 420, 419, 418, 417, 416, 415, 414, 413, 412, 411, 410, 409, 408, 407, 406, 405, 404, 403, 402, 401, 400, 399, 398, 397, 396, 395, 394, 393, 322, .
  . . .

  31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15,
  14, 453, 455, 13, 454, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]

  value 454 is here. But wrong position.





Follow ups

References