'int' object is unsubscriptable in Compute Asset

Bug #865263 reported by Ivan Wirawan
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Won't Fix
Undecided
Bogdan Stanciu

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

Revision history for this message
Ivan Wirawan (niecw) wrote :
Revision history for this message
Vishal Parmar(Open ERP) (vpa-openerp) wrote :

Hello Ivan,

I have checked your issue with account_asset module of latest trunk which is currently available in official

addons so you can try with this module instead of "account_fixed_assets". I have attached video for your more

reference would you please check it.

Our R&D Teams are focused on the latest OpenERP version, and this issue does not affect it.

Our policy is to keep the changes applied on stable branches to a minimum, in order to limit the regression risks

for customers that are in production. This means that bugs reported on Launchpad are fixed in the trunk branch

only by default, even if they were reported against other stable versions.

Thank you for your understanding!

Revision history for this message
Vishal Parmar(Open ERP) (vpa-openerp) wrote :
Changed in openobject-addons:
status: New → Won't Fix
Revision history for this message
Ivan Wirawan (niecw) wrote :

That's perfectly OK. Congratulation on the new official module, it looks great.
Would you be so kind to spare me the trouble to look where I could find more on the new module?

Thank you.

Changed in openobject-addons:
assignee: nobody → Bogdan Stanciu (bstanciu)
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

Bug attachments

Remote bug watches

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