=== modified file 'stock/stock.py' --- stock/stock.py 2012-02-15 18:00:28 +0000 +++ stock/stock.py 2012-02-27 18:10:41 +0000 @@ -2211,6 +2211,14 @@ """ Makes the move done and if all moves are done, it will finish the picking. @return: """ + + partial_datas='' + partial_obj=self.pool.get('stock.partial.picking') + partial_id=partial_obj.search(cr,uid,[]) + + if partial_id: + partial_datas = partial_obj.read(cr, uid, partial_id, context=context)[0] + picking_ids = [] move_ids = [] wf_service = netsvc.LocalService("workflow") @@ -2236,6 +2244,10 @@ self.write(cr, uid, [move.id], {'move_history_ids': [(4, move.move_dest_id.id)]}) #cr.execute('insert into stock_move_history_ids (parent_id,child_id) values (%s,%s)', (move.id, move.move_dest_id.id)) if move.move_dest_id.state in ('waiting', 'confirmed'): + if partial_datas['picking_id'][1][:2] == 'IN' and move.location_dest_id: + self.write(cr, uid, [move.move_dest_id.id], {'location_dest_id': move.location_dest_id.id}) + if move.prodlot_id.id and move.product_id.id == move.move_dest_id.product_id.id: + self.write(cr, uid, [move.move_dest_id.id], {'prodlot_id':move.prodlot_id.id}) self.force_assign(cr, uid, [move.move_dest_id.id], context=context) if move.move_dest_id.picking_id: wf_service.trg_write(uid, 'stock.picking', move.move_dest_id.picking_id.id, cr) @@ -2243,6 +2255,12 @@ self.action_done(cr, uid, [move.move_dest_id.id], context=context) self._create_product_valuation_moves(cr, uid, move, context=context) + prodlot_id = partial_datas and partial_datas.get('move%s_prodlot_id' % (move.id), False) + if prodlot_id: + self.write(cr, uid, [move.id], {'prodlot_id': prodlot_id}, context=context) + + + if move.state not in ('confirmed','done','assigned'): todo.append(move.id)