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
=== modified file 'stock/wizard/stock_return_picking.py'
--- stock/wizard/stock_return_picking.py 2012-06-12 16:15:51 +0000
+++ stock/wizard/stock_return_picking.py 2012-11-27 15:41:26 +0000
@@ -183,6 +183,9 @@
183183
184 if returned_qty != new_qty:184 if returned_qty != new_qty:
185 set_invoice_state_to_none = False185 set_invoice_state_to_none = False
186 current_move = move
187 if current_move.move_history_ids2 and move.location_id.chained_auto_packing == 'manual':
188 current_move = current_move.move_history_ids2[0]
186 if new_qty:189 if new_qty:
187 returned_lines += 1190 returned_lines += 1
188 new_move=move_obj.copy(cr, uid, move.id, {191 new_move=move_obj.copy(cr, uid, move.id, {
@@ -190,7 +193,7 @@
190 'product_uos_qty': uom_obj._compute_qty(cr, uid, move.product_uom.id,193 'product_uos_qty': uom_obj._compute_qty(cr, uid, move.product_uom.id,
191 new_qty, move.product_uos.id),194 new_qty, move.product_uos.id),
192 'picking_id':new_picking, 'state':'draft',195 'picking_id':new_picking, 'state':'draft',
193 'location_id':new_location, 'location_dest_id':move.location_id.id,196 'location_id':new_location, 'location_dest_id':current_move.location_id.id,
194 'date':date_cur,})197 'date':date_cur,})
195 move_obj.write(cr, uid, [move.id], {'move_history_ids2':[(4,new_move)]})198 move_obj.write(cr, uid, [move.id], {'move_history_ids2':[(4,new_move)]})
196 if not returned_lines:199 if not returned_lines: