[FIX] mrp_repair: don't try to compare a date object with a datetime object

bzr revid: olt@tinyerp.com-20101004114819-0b8xhsjytfxgll8t
This commit is contained in:
olt@tinyerp.com 2010-10-04 13:48:19 +02:00
parent 8e1b7362c9
commit d51ad12b0c
1 changed files with 2 additions and 1 deletions

View File

@ -687,8 +687,9 @@ class mrp_repair_line(osv.osv, ProductChangeMixin):
if type == 'add':
stock_id = self.pool.get('stock.location').search(cr, uid, [('name','=','Stock')])[0]
to_invoice = False
if guarantee_limit and date.today() > datetime.strptime(guarantee_limit, '%Y-%m-%d'):
if guarantee_limit and datetime.strptime(date.today().strftime('%Y-%m-%d'), '%Y-%m-%d') > datetime.strptime(guarantee_limit, '%Y-%m-%d'):
to_invoice=True
return {'value': {
'to_invoice': to_invoice,
'location_id': stock_id,