[6.1, 7.0, trunk] return product messed up when output location manually chained to customer location

Bug #1075559 reported by Alexandre Fayolle - camptocamp
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
New
Undecided
OpenERP Publisher's Warranty Team

Bug Description

If you setup you warehouse with the Output location manually chained to the customer location, then returning goods is messed up.

A Sale Order will generate a move from Stock to Output, and the chained location setup will generate a move from Output to Customer. When the customer returns the good for any reason, the user will use the stock return picking wizard from the OUT picking. This generates an incoming move from Customer to Output, and the chained location setup generates in turn an outgoing move from Output to Customer (and when the incoming picking is processed, the outgoing move gets available...)

This is wrong, as it totally messes up the logistics of the company, and it is a big problem for an e-commerce company handling over 100 SO per day, with 5% return rate, as it requires a lot of manual processing. In my opinion, there should never be an *incoming* move to the *Output* location of the warehouse. This would solve the problem.

There should be a setting on the shop specifying which location is to be used for returns, or the stock return picking wizard should provide a way of specifying a location on a case by case basis.

Tags: maintenance

Related branches

Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

OPW opened for this ticket

Changed in openobject-addons:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
tags: added: maintenance
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

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:

Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

Improved fix for 6.1 in the attached branch

Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote : Re: [6.1, 7.0] return product messed up when output location manually chained to customer location

Still exists in 7.0

summary: - [6.1] return product messed up when output location manually chained to
- customer location
+ [6.1, 7.0] return product messed up when output location manually
+ chained to customer location
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Confirmed in trunk as well

summary: - [6.1, 7.0] return product messed up when output location manually
+ [6.1, 7.0, trunk] return product messed up when output location manually
chained to customer location
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

The fix won't work with a duplication of a picking.out as picking's move will have Output location as oldest ancestor location. Thus the fix won't be able to descend on a valid location.

A patch is attached which ensure we use Stock location of warhouse if location found in history is an Output location

no longer affects: ocb-addons/6.1
no longer affects: ocb-addons/7.0
no longer affects: ocb-addons
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.