[FIX] Purchase : Seperate packign should not be created if chained locations are used.

bzr revid: jma@tinyerp.com-20100512063147-pclqvd6p7lo52apf
This commit is contained in:
JMA (OpenERP) 2010-05-12 12:01:47 +05:30
parent 1cb850841a
commit 0fd5a4477e
1 changed files with 4 additions and 2 deletions

View File

@ -413,6 +413,7 @@ class purchase_order(osv.osv):
'purchase_id': order.id,
'company_id': order.company_id.id,
})
todo_moves = []
for order_line in order.order_line:
if not order_line.product_id:
continue
@ -436,8 +437,9 @@ class purchase_order(osv.osv):
})
if order_line.move_dest_id:
self.pool.get('stock.move').write(cr, uid, [order_line.move_dest_id.id], {'location_id':order.location_id.id})
self.pool.get('stock.move').action_confirm(cr, uid, [move])
self.pool.get('stock.move').force_assign(cr,uid, [move])
todo_moves.append(move)
self.pool.get('stock.move').action_confirm(cr, uid, todo_moves)
self.pool.get('stock.move').force_assign(cr, uid, todo_moves)
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
return picking_id