From 1876279f2f6a51467ae29a82cf8fc269503476bc Mon Sep 17 00:00:00 2001
From: Goffin Simon <sig@odoo.com>
Date: Wed, 11 May 2016 15:30:19 +0200
Subject: [PATCH] [FIX] stock: Reversing scrapped moves

When reversing stock moves by clicking on "Reverse" in stock.picking
form view, only the stock moves not scrapped must be reversed.

opw:672236
---
 addons/stock/wizard/stock_return_picking.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/addons/stock/wizard/stock_return_picking.py b/addons/stock/wizard/stock_return_picking.py
index 12ccadc416f6..22d2208ceee9 100644
--- a/addons/stock/wizard/stock_return_picking.py
+++ b/addons/stock/wizard/stock_return_picking.py
@@ -58,6 +58,8 @@ class stock_return_picking(osv.osv_memory):
                 raise UserError(_("You may only return pickings that are Done!"))
 
             for move in pick.move_lines:
+                if move.scrapped:
+                    continue
                 if move.move_dest_id:
                     chained_move_exist = True
                 #Sum the quants in that location that can be returned (they should have been moved by the moves that were included in the returned picking)
-- 
GitLab