Merge lp:~camptocamp/openobject-addons/6.1-fix-1075559 into lp:openobject-addons/6.1

Proposed by Alexandre Fayolle - camptocamp
Status: Needs review
Proposed branch: lp:~camptocamp/openobject-addons/6.1-fix-1075559
Merge into: lp:openobject-addons/6.1
Diff against target: 22 lines (+4/-1)
1 file modified
stock/wizard/stock_return_picking.py (+4/-1)
To merge this branch: bzr merge lp:~camptocamp/openobject-addons/6.1-fix-1075559
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+136448@code.launchpad.net

Description of the change

fix the computation of the move destination in the stock return picking wizard to avoid loops when the Output location of the warehouse is manually chained to the Customer location.

To post a comment you must log in.

Unmerged revisions

7084. By Alexandre Fayolle @ camptocamp <email address hidden>

[FIX] stock_return_picking wizard: improve fix, only unravel if the location of the move is manually chained

7083. By Alexandre Fayolle @ camptocamp <email address hidden>

[FIX] stock_return_picking wizard: unchain one level of chained moves when computing customer returns

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'stock/wizard/stock_return_picking.py'
2--- stock/wizard/stock_return_picking.py 2012-06-12 16:15:51 +0000
3+++ stock/wizard/stock_return_picking.py 2012-11-27 15:41:26 +0000
4@@ -183,6 +183,9 @@
5
6 if returned_qty != new_qty:
7 set_invoice_state_to_none = False
8+ current_move = move
9+ if current_move.move_history_ids2 and move.location_id.chained_auto_packing == 'manual':
10+ current_move = current_move.move_history_ids2[0]
11 if new_qty:
12 returned_lines += 1
13 new_move=move_obj.copy(cr, uid, move.id, {
14@@ -190,7 +193,7 @@
15 'product_uos_qty': uom_obj._compute_qty(cr, uid, move.product_uom.id,
16 new_qty, move.product_uos.id),
17 'picking_id':new_picking, 'state':'draft',
18- 'location_id':new_location, 'location_dest_id':move.location_id.id,
19+ 'location_id':new_location, 'location_dest_id':current_move.location_id.id,
20 'date':date_cur,})
21 move_obj.write(cr, uid, [move.id], {'move_history_ids2':[(4,new_move)]})
22 if not returned_lines: