Priyesh (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.1-opw-575526-pso into 
lp:openobject-addons/6.1.

Requested reviews:
  Olivier Dony (OpenERP) (odo-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-575526-pso/+merge/109142

Hello,

To reproduced the issue, here are the steps:

- Create a new product:
Stockable / Make to order / Buy
Check the boxes for the incoming and the outgoing traceability (Track 
Incoming/Outcoming Lots)

- Create a Sale Order for x PRODUCT
- Run the scheduler
- Confirm the Request for Quotation
- Receive the product
- Process the reception
- Create a new production lot
- Process the internal move (toward this new lot)
- Deliver the product (from this lot) -> State: done
- Click on Return Products

-> Window with the error message

kindly review the branch and let me know your inputs on it.

Regards,
Priyesh
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-575526-pso/+merge/109142
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.1-opw-575526-pso.
=== modified file 'stock/wizard/stock_return_picking.py'
--- stock/wizard/stock_return_picking.py	2012-04-25 07:20:05 +0000
+++ stock/wizard/stock_return_picking.py	2012-06-07 13:24:20 +0000
@@ -123,7 +123,12 @@
             if m.state == 'done':
                 return_history[m.id] = 0
                 for rec in m.move_history_ids2:
-                    return_history[m.id] += (rec.product_qty * rec.product_uom.factor)
+                    # only take into account 'product return' stock move
+                    # (i.e move with exact opposite of ours:
+                    #     (location, dest location) = (dest location, location))
+                    if rec.location_dest_id.id == m.location_id.id \
+                        and rec.location_id.id == m.location_dest_id.id:
+                        return_history[m.id] += (rec.product_qty * rec.product_uom.factor)
         return return_history
 
     def create_returns(self, cr, uid, ids, context=None):

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to