[IMP] mrp_repair: reverse boolean test to reduce nesting
bzr revid: xmo@openerp.com-20101005080013-7ssjz1tnlqe0cqdz
This commit is contained in:
parent
f291106692
commit
a392e830d7
|
@ -684,22 +684,24 @@ class mrp_repair_line(osv.osv, ProductChangeMixin):
|
|||
}
|
||||
}
|
||||
produc_id = self.pool.get('stock.location').search(cr, uid, [('name','=','Production')])[0]
|
||||
if type == 'add':
|
||||
stock_id = self.pool.get('stock.location').search(cr, uid, [('name','=','Stock')])[0]
|
||||
to_invoice = False
|
||||
if guarantee_limit and datetime.now() > datetime.strptime(guarantee_limit, '%Y-%m-%d'):
|
||||
to_invoice=True
|
||||
|
||||
if type != 'add':
|
||||
return {'value': {
|
||||
'to_invoice': to_invoice,
|
||||
'location_id': stock_id,
|
||||
'location_dest_id': produc_id
|
||||
}
|
||||
}
|
||||
return {'value': {
|
||||
'to_invoice': False,
|
||||
'location_id': produc_id,
|
||||
'location_dest_id': False
|
||||
}
|
||||
}
|
||||
|
||||
stock_id = self.pool.get('stock.location').search(cr, uid, [('name','=','Stock')])[0]
|
||||
to_invoice = False
|
||||
if guarantee_limit and datetime.now() > datetime.strptime(guarantee_limit, '%Y-%m-%d'):
|
||||
to_invoice=True
|
||||
|
||||
return {'value': {
|
||||
'to_invoice': to_invoice,
|
||||
'location_id': stock_id,
|
||||
'location_dest_id': produc_id
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue