From 6c466aa2e04487dbfae6de1dd2de416acc5f62a0 Mon Sep 17 00:00:00 2001 From: Joan Sisquella Date: Mon, 9 Dec 2019 12:58:58 +0100 Subject: [PATCH] [11.0][FIX] stock_move_location: * fix test as per migration * fix inconsistency in reserved quantity for planned transfers --- stock_move_location/tests/test_move_location.py | 1 - stock_move_location/wizard/stock_move_location.py | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stock_move_location/tests/test_move_location.py b/stock_move_location/tests/test_move_location.py index be2286571..4c7f2bb60 100644 --- a/stock_move_location/tests/test_move_location.py +++ b/stock_move_location/tests/test_move_location.py @@ -100,7 +100,6 @@ class TestMoveLocation(TestsCommon): """Test planned transfer.""" wizard = self._create_wizard(self.internal_loc_1, self.internal_loc_2) wizard.onchange_origin_location() - wizard.add_lines() wizard = wizard.with_context({'planned': True}) wizard.action_move_location() picking = wizard.picking_id diff --git a/stock_move_location/wizard/stock_move_location.py b/stock_move_location/wizard/stock_move_location.py index 287b727f8..d7049fb63 100644 --- a/stock_move_location/wizard/stock_move_location.py +++ b/stock_move_location/wizard/stock_move_location.py @@ -151,8 +151,9 @@ class StockMoveLocationWizard(models.TransientModel): move = self.env["stock.move"].create( self._get_move_values(picking, lines), ) - for line in lines: - line.create_move_lines(picking, move) + if not self.env.context.get("planned"): + for line in lines: + line.create_move_lines(picking, move) return move @api.multi