From 4948e21e328a1c0f655edccdad15f93d4aa93ff0 Mon Sep 17 00:00:00 2001 From: pilarvargas-tecnativa Date: Fri, 22 Mar 2024 16:16:35 +0100 Subject: [PATCH] [FIX] stock_move_location: correct method _get_putaway_strategy name TT48457 --- stock_move_location/tests/test_move_location.py | 6 ++++++ stock_move_location/wizard/stock_move_location_line.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/stock_move_location/tests/test_move_location.py b/stock_move_location/tests/test_move_location.py index a979057f1..34f036fb5 100644 --- a/stock_move_location/tests/test_move_location.py +++ b/stock_move_location/tests/test_move_location.py @@ -206,6 +206,12 @@ class TestMoveLocation(TestsCommon): self.assertEqual( putaway_line.destination_location_id, self.internal_loc_2_shelf ) + picking_action = wizard.action_move_location() + picking = self.env["stock.picking"].browse(picking_action["res_id"]) + move_lines = picking.move_line_ids.filtered( + lambda sml: sml.product_id == self.product_no_lots + ) + self.assertEqual(move_lines.location_dest_id, self.internal_loc_2_shelf) def test_delivery_order_assignation_after_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 4a3c6cf91..3d8405239 100644 --- a/stock_move_location/wizard/stock_move_location_line.py +++ b/stock_move_location/wizard/stock_move_location_line.py @@ -98,7 +98,7 @@ class StockMoveLocationWizardLine(models.TransientModel): self.ensure_one() location_dest_id = ( self.move_location_wizard_id.apply_putaway_strategy - and self.destination_location_id.get_putaway_strategy(self.product_id).id + and self.destination_location_id._get_putaway_strategy(self.product_id).id or self.destination_location_id.id ) qty_todo, qty_done = self._get_available_quantity()