** 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))



_______________________________________________
Mailing list: https://launchpad.net/~c2c-oerpscenario
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~c2c-oerpscenario
More help   : https://help.launchpad.net/ListHelp

Reply via email to