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

bzr revid: rha@tinyerp.com-20101216060145-pek6uv2pckkodlyt
This commit is contained in:
rha@tinyerp.com
2010-12-16 11:31:45 +05:30
parent d24451dcd6
commit 2aefa41343
+1 -1
View File
@@ -222,7 +222,7 @@ class mrp_repair(osv.osv):
if move_id:
move = self.pool.get('stock.move').browse(cr, uid, move_id)
product = self.pool.get('product.product').browse(cr, uid, prod_id)
limit = datetime.strptime(move.date_expected, '%Y-%m-%d %H:%M:%S') + relativedelta(months=product.warranty)
limit = datetime.strptime(move.date_expected, '%Y-%m-%d %H:%M:%S') + relativedelta(months=int(product.warranty))
data['value']['guarantee_limit'] = limit.strftime('%Y-%m-%d')
data['value']['location_id'] = move.location_dest_id.id
data['value']['location_dest_id'] = move.location_dest_id.id