1
=== modified file 'stock/stock.py'
2
--- stock/stock.py 2012-03-27 08:34:40 +0000
3
+++ stock/stock.py 2012-04-27 08:53:24 +0000
5
""" Makes the move done and if all moves are done, it will finish the picking.
10
+ partial_obj=self.pool.get('stock.partial.picking')
11
+ partial_id=partial_obj.search(cr,uid,[])
14
+ partial_datas = partial_obj.read(cr, uid, partial_id, context=context)[0]
18
wf_service = netsvc.LocalService("workflow")
19
@@ -2236,6 +2244,10 @@
20
self.write(cr, uid, [move.id], {'move_history_ids': [(4, move.move_dest_id.id)]})
21
#cr.execute('insert into stock_move_history_ids (parent_id,child_id) values (%s,%s)', (move.id, move.move_dest_id.id))
22
if move.move_dest_id.state in ('waiting', 'confirmed'):
23
+ if partial_datas and partial_datas['picking_id'][1][:2] == 'IN' and move.location_dest_id:
24
+ self.write(cr, uid, [move.move_dest_id.id], {'location_dest_id': move.location_dest_id.id})
25
+ if move.prodlot_id.id and move.product_id.id == move.move_dest_id.product_id.id:
26
+ self.write(cr, uid, [move.move_dest_id.id], {'prodlot_id':move.prodlot_id.id})
27
self.force_assign(cr, uid, [move.move_dest_id.id], context=context)
28
if move.move_dest_id.picking_id:
29
wf_service.trg_write(uid, 'stock.picking', move.move_dest_id.picking_id.id, cr)
30
@@ -2243,6 +2255,12 @@
31
self.action_done(cr, uid, [move.move_dest_id.id], context=context)
33
self._create_product_valuation_moves(cr, uid, move, context=context)
34
+ prodlot_id = partial_datas and partial_datas.get('move%s_prodlot_id' % (move.id), False)
36
+ self.write(cr, uid, [move.id], {'prodlot_id': prodlot_id}, context=context)
40
if move.state not in ('confirmed','done','assigned'):