← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 690234] Re: 6.0 RC1 mrp_repair error if repair contains a product that its warranty is not multiple of 12

 

** Changed in: openobject-addons
       Status: Confirmed => In Progress

-- 
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/690234

Title:
  6.0 RC1 mrp_repair error if repair contains a product that its warranty is not multiple of 12

Status in OpenObject Addons Modules:
  In Progress

Bug description:
  6.0 RC1 mrp_repair module:

An error appears when a repair is created and a product whose warranty is not multiple of 12 is selected.

  File "/home/bin/addons/mrp_repair/mrp_repair.py", line 225, in onchange_move_id
    limit = datetime.strptime(move.date_expected, '%Y-%m-%d %H:%M:%S') + relativedelta(months=product.warranty)
  File "/var/lib/python-support/python2.5/dateutil/relativedelta.py", line 261, in __radd__
    day = min(calendar.monthrange(year, month)[1],
  File "/usr/lib/python2.5/calendar.py", line 123, in monthrange
    ndays = mdays[month] + (month == February and isleap(year))
TypeError: list indices must be integers

It could be fixed changing file "mrp_repair/mrp_repair.py", line 225, in onchange_move_id

limit = datetime.strptime(move.date_expected, '%Y-%m-%d %H:%M:%S') + relativedelta(months=product.warranty)

to

limit = datetime.strptime(move.date_expected, '%Y-%m-%d %H:%M:%S') + relativedelta(months=int(product.warranty))





References