← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 865263] [NEW] 'int' object is unsubscriptable in Compute Asset

 

Public bug reported:

This is pertaining to revno 4633.

When the Compute Asset wizard is executed (Accounting >> Periodical
Processing >> Asset Calculation >> Compute Asset), it produces 'int'
object is unsubscriptable error.  Below is the detailed stack trace.

The source of the problem is line 69 of wizard/account_fixed_assets_compute.py, which is:
     period = obj_asset._check_date(cr, uid, data['period_id'], data['date'], context)
It passes the data['period_id'] as an integer (id) whereas the _check_date method is expecting a list.

Attached is the proposed patch for this bug.

The following is the stack trace:
  File "../openobject-server/bin/netsvc.py", line 489, in dispatch
    result = ExportService.getService(service_name).dispatch(method, auth, params)
  File "../openobject-server/bin/service/web_services.py", line 599, in dispatch
    res = fn(db, uid, *params)
  File "../openobject-server/bin/osv/osv.py", line 122, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "../openobject-server/bin/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "../openobject-server/bin/osv/osv.py", line 167, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "../openobject-addons/account_fixed_assets/wizard/account_fixed_assets_compute.py", line 69, in compute_assets
    period = obj_asset._check_date(cr, uid, data['period_id'], data['date'], context)
  File "../openobject-addons/account_fixed_assets/account_asset.py", line 806, in _check_date
    period = period_obj.browse(cr, uid, period_id[0], context=context)
TypeError: 'int' object is unsubscriptable

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

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

Title:
  'int' object is unsubscriptable in Compute Asset

Status in OpenERP Addons (modules):
  New

Bug description:
  This is pertaining to revno 4633.

  When the Compute Asset wizard is executed (Accounting >> Periodical
  Processing >> Asset Calculation >> Compute Asset), it produces 'int'
  object is unsubscriptable error.  Below is the detailed stack trace.

  The source of the problem is line 69 of wizard/account_fixed_assets_compute.py, which is:
       period = obj_asset._check_date(cr, uid, data['period_id'], data['date'], context)
  It passes the data['period_id'] as an integer (id) whereas the _check_date method is expecting a list.

  Attached is the proposed patch for this bug.

  The following is the stack trace:
    File "../openobject-server/bin/netsvc.py", line 489, in dispatch
      result = ExportService.getService(service_name).dispatch(method, auth, params)
    File "../openobject-server/bin/service/web_services.py", line 599, in dispatch
      res = fn(db, uid, *params)
    File "../openobject-server/bin/osv/osv.py", line 122, in wrapper
      return f(self, dbname, *args, **kwargs)
    File "../openobject-server/bin/osv/osv.py", line 176, in execute
      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
    File "../openobject-server/bin/osv/osv.py", line 167, in execute_cr
      return getattr(object, method)(cr, uid, *args, **kw)
    File "../openobject-addons/account_fixed_assets/wizard/account_fixed_assets_compute.py", line 69, in compute_assets
      period = obj_asset._check_date(cr, uid, data['period_id'], data['date'], context)
    File "../openobject-addons/account_fixed_assets/account_asset.py", line 806, in _check_date
      period = period_obj.browse(cr, uid, period_id[0], context=context)
  TypeError: 'int' object is unsubscriptable

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/865263/+subscriptions


Follow ups

References