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