diff options
| author | Xavier Morel <xmo@openerp.com> | 2010-10-05 10:03:12 +0200 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2010-10-05 10:03:12 +0200 |
| commit | 14559bb42e5d4a48ee76dc88f3c539fec5ac620f (patch) | |
| tree | 80cccd8f49ff2ab067723b958bedf9a320e229b8 | |
| parent | be1a8c1e604749abf7ee3480839b37552209b85e (diff) | |
[IMP] mrp_repair: simplify boolean temp variable setting
bzr revid: xmo@openerp.com-20101005080312-h3nzrhvjogoc7o6q
| -rw-r--r-- | addons/mrp_repair/mrp_repair.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index a4bfe9457e7..1a9705ce122 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -683,8 +683,8 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): 'location_dest_id': False } } - product_id = self.pool.get('stock.location').search(cr, uid, [('name','=','Production')])[0] + product_id = self.pool.get('stock.location').search(cr, uid, [('name','=','Production')])[0] if type != 'add': return {'value': { 'to_invoice': False, @@ -694,10 +694,8 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): } 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 - + to_invoice = (guarantee_limit and + datetime.strptime(guarantee_limit, '%Y-%m-%d') < datetime.now()): return {'value': { 'to_invoice': to_invoice, 'location_id': stock_id, |
