Priyesh (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/6.0-opw-575526-pso into
lp:openobject-addons/6.0.
Requested reviews:
Olivier Dony (OpenERP) (odo-openerp)
Related bugs:
Bug #944025 in OpenERP Addons: "Cannot return outgoing moves if there are
chained moves (including MTO products, products in a lot, settings with chained
warehouse locations...)"
https://bugs.launchpad.net/openobject-addons/+bug/944025
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-575526-pso/+merge/109149
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.0-opw-575526-pso/+merge/109149
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/6.0-opw-575526-pso.
=== modified file 'stock/wizard/stock_return_picking.py'
--- stock/wizard/stock_return_picking.py 2011-01-18 13:41:41 +0000
+++ stock/wizard/stock_return_picking.py 2012-06-07 13:36:21 +0000
@@ -81,7 +81,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)
if m.product_qty * m.product_uom.factor >= return_history[m.id]:
valid_lines += 1
if 'return%s'%(m.id) not in self._columns:
_______________________________________________
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