From b5cd612a223bf590ad2477f0e3aad95f20dfda1d Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Thu, 3 May 2012 14:12:53 +0200 Subject: [PATCH] [FIX] stock, fixing the runbot: incomming shipments are always set as available ONLY if they aren't chained and waiting for another move to be processed bzr revid: qdp-launchpad@openerp.com-20120503121253-07u62yctdl42epie --- addons/stock/stock.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 57e12c7f0b8..e2b32a009b6 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -892,10 +892,11 @@ class stock_picking(osv.osv): ok = True for pick in self.browse(cr, uid, ids): mt = pick.move_type - for move in pick.move_lines: - # incomming shipments are always set as available - if pick.type == 'in': + # incomming shipments are always set as available if they aren't chained + if pick.type == 'in': + if all([x.state != 'waiting' for x in pick.move_lines]): return True + for move in pick.move_lines: if (move.state in ('confirmed', 'draft')) and (mt == 'one'): return False if (mt == 'direct') and (move.state == 'assigned') and (move.product_qty):