[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
This commit is contained in:
Quentin (OpenERP)
2012-05-03 14:12:53 +02:00
parent f7740ecbcb
commit b5cd612a22
+4 -3
View File
@@ -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):