diff --git a/stock_move_location/tests/test_move_location.py b/stock_move_location/tests/test_move_location.py index 57825106f..de1a04559 100644 --- a/stock_move_location/tests/test_move_location.py +++ b/stock_move_location/tests/test_move_location.py @@ -106,7 +106,7 @@ class TestMoveLocation(TestsCommon): self.assertEqual(len(picking.move_line_ids), 4) self.assertEqual( sorted(picking.move_line_ids.mapped("qty_done")), - [1, 1, 1, 123], + [0.0, 0.0, 0.0, 0.0], ) def test_quant_transfer(self): diff --git a/stock_move_location/wizard/stock_move_location_line.py b/stock_move_location/wizard/stock_move_location_line.py index e05c0ae00..518be6e0b 100644 --- a/stock_move_location/wizard/stock_move_location_line.py +++ b/stock_move_location/wizard/stock_move_location_line.py @@ -83,7 +83,8 @@ class StockMoveLocationWizardLine(models.TransientModel): def create_move_lines(self, picking, move): for line in self: values = line._get_move_line_values(picking, move) - if values.get("qty_done") <= 0: + if not self.env.context.get("planned") and \ + values.get("qty_done") <= 0: continue self.env["stock.move.line"].create( values @@ -116,7 +117,7 @@ class StockMoveLocationWizardLine(models.TransientModel): return 0 if self.env.context.get("planned"): # for planned transfer we don't care about the amounts at all - return self.move_quantity + return 0.0 search_args = [ ('location_id', '=', self.origin_location_id.id), ('product_id', '=', self.product_id.id),