← Back to team overview

openerp-community-reviewer team mailing list archive

lp:~yann-papouin/ocb-addons/6.1-bug-1104766-ignore-canceled-moves into lp:ocb-addons/6.1

 

Yann Papouin has proposed merging lp:~yann-papouin/ocb-addons/6.1-bug-1104766-ignore-canceled-moves into lp:ocb-addons/6.1.

Requested reviews:
  OpenERP Community Backports Team (ocb)
Related bugs:
  Bug #1104766 in OpenERP Community Backports (Addons): "Product Return Canceled"
  https://bugs.launchpad.net/ocb-addons/+bug/1104766

For more details, see:
https://code.launchpad.net/~yann-papouin/ocb-addons/6.1-bug-1104766-ignore-canceled-moves/+merge/197753
-- 
https://code.launchpad.net/~yann-papouin/ocb-addons/6.1-bug-1104766-ignore-canceled-moves/+merge/197753
Your team OpenERP Community Backports Team is requested to review the proposed merge of lp:~yann-papouin/ocb-addons/6.1-bug-1104766-ignore-canceled-moves into lp:ocb-addons/6.1.
=== modified file 'stock/wizard/stock_return_picking.py'
--- stock/wizard/stock_return_picking.py	2013-12-02 12:17:08 +0000
+++ stock/wizard/stock_return_picking.py	2013-12-04 16:35:49 +0000
@@ -72,9 +72,10 @@
                     res.update({'invoice_state': 'none'})
             return_history = self.get_return_history(cr, uid, record_id, context)       
             for line in pick.move_lines:
-                qty = line.product_qty - return_history[line.id]
-                if qty > 0:
-                    result1.append({'product_id': line.product_id.id, 'quantity': qty,'move_id':line.id})
+                if line.state <> 'cancel':
+                    qty = line.product_qty - return_history[line.id]
+                    if qty > 0:
+                        result1.append({'product_id': line.product_id.id, 'quantity': qty,'move_id':line.id})
             if 'product_return_moves' in fields:
                 res.update({'product_return_moves': result1})
         return res
@@ -128,7 +129,7 @@
                     # a valid return move will be the exact opposite of ours:
                     #     (src location, dest location) <=> (dest location, src location))
                     if rec.location_dest_id.id == m.location_id.id \
-                        and rec.location_id.id == m.location_dest_id.id:
+                        and rec.location_id.id == m.location_dest_id.id and rec.state != 'cancel':
                         return_history[m.id] += (rec.product_qty * rec.product_uom.factor)
         return return_history
 


Follow ups