From 5e58be6508b978339f8f3a035f5d4cd511cb79b6 Mon Sep 17 00:00:00 2001 From: Pierre Masereel Date: Wed, 13 Mar 2019 10:43:36 +0000 Subject: [PATCH] [FIX] stock: show all not scrapped move When a move is created in a picking through the scrap button, it must not be visible in the picking, and should be accible through the stat button showing the srap. Now to hide, those moves from the picking view, we are checking that the move has a different picking type than the one on the picking, which can lead to invisible moves, that are not in the picking view because they have a different picking type and not in the scrap stat button because they don't have scrap object. To fix this behavior, we are hiding from the picking the ones having a scrap object linked instead of the one having a different picking type closes odoo/odoo#31810 Signed-off-by: pimodoo --- addons/stock/models/stock_picking.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/models/stock_picking.py b/addons/stock/models/stock_picking.py index bc60cb19265..4c5a280034c 100644 --- a/addons/stock/models/stock_picking.py +++ b/addons/stock/models/stock_picking.py @@ -651,7 +651,7 @@ class Picking(models.Model): move_ids_without_package |= move else: move_ids_without_package |= move - picking.move_ids_without_package = move_ids_without_package.filtered(lambda move: move.picking_type_id == picking.picking_type_id) + picking.move_ids_without_package = move_ids_without_package.filtered(lambda move: not move.scrap_ids) def _set_move_without_package(self): self.move_lines |= self.move_ids_without_package