For those affected by the bug, here is a patch for 6.1 that works around it.
=== modified file 'stock/wizard/stock_return_picking.py' --- stock/wizard/stock_return_picking.py 2012-08-10 13:41:53 +0000 +++ stock/wizard/stock_return_picking.py 2012-11-27 15:17:10 +0000 @@ -188,6 +188,9 @@
if returned_qty != new_qty: set_invoice_state_to_none = False + current_move = move + if current_move.move_history_ids2: + current_move = current_move.move_history_ids2[0] if new_qty: returned_lines += 1 new_move=move_obj.copy(cr, uid, move.id, { @@ -195,7 +198,7 @@ 'product_uos_qty': uom_obj._compute_qty(cr, uid, move.product_uom.id, new_qty, move.product_uos.id), 'picking_id':new_picking, 'state':'draft', - 'location_id':new_location, 'location_dest_id':move.location_id.id, + 'location_id':new_location, 'location_dest_id':current_move.location_id.id, 'date':date_cur,}) move_obj.write(cr, uid, [move.id], {'move_history_ids2':[(4,new_move)]}) if not returned_lines:
For those affected by the bug, here is a patch for 6.1 that works around it.
=== modified file 'stock/ wizard/ stock_return_ picking. py' stock_return_ picking. py 2012-08-10 13:41:53 +0000 stock_return_ picking. py 2012-11-27 15:17:10 +0000
--- stock/wizard/
+++ stock/wizard/
@@ -188,6 +188,9 @@
if returned_qty != new_qty:
set_ invoice_ state_to_ none = False move.move_ history_ ids2: move.move_ history_ ids2[0]
returned_ lines += 1
new_ move=move_ obj.copy( cr, uid, move.id, {
'product_ uos_qty' : uom_obj. _compute_ qty(cr, uid, move.product_ uom.id,
new_ qty, move.product_ uos.id) ,
'picking_ id':new_ picking, 'state':'draft', id':new_ location, 'location_ dest_id' :move.location_ id.id, id':new_ location, 'location_ dest_id' :current_ move.location_ id.id,
'date': date_cur, })
move_ obj.write( cr, uid, [move.id], {'move_ history_ ids2':[ (4,new_ move)]} )
+ current_move = move
+ if current_
+ current_move = current_
if new_qty:
@@ -195,7 +198,7 @@
- 'location_
+ 'location_
if not returned_lines: