From 261a53de2cbb209f0f79004af0ce0732de2c9718 Mon Sep 17 00:00:00 2001 From: AaronHForgeFlow Date: Thu, 23 Nov 2023 17:25:51 +0100 Subject: [PATCH] [FIX] rma_account: tests for multistep quantity --- rma_account/tests/test_rma_stock_account.py | 22 +++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/rma_account/tests/test_rma_stock_account.py b/rma_account/tests/test_rma_stock_account.py index 700e81a7e..5a0783290 100644 --- a/rma_account/tests/test_rma_stock_account.py +++ b/rma_account/tests/test_rma_stock_account.py @@ -259,8 +259,10 @@ def test_08_cost_from_move_multi_step(self): """ # Alter the customer RMA route to make it multi-step # Get rid of the duplicated rule - self.env.ref("rma.rule_rma_customer_out_pull").active = False - self.env.ref("rma.rule_rma_customer_in_pull").active = False + self.customer_route.rule_ids.active = False + self.env["stock.location.route"].search([]).active = False + self.customer_route.active = True + # to be able to receive in in WH cust_in_pull_rule = self.customer_route.rule_ids.filtered( lambda r: r.location_id == self.stock_rma_location ) @@ -275,11 +277,12 @@ def test_08_cost_from_move_multi_step(self): "name": "RMA->Output", "action": "pull", "warehouse_id": self.wh.id, - "location_src_id": self.env.ref("rma.location_rma").id, + "location_src_id": self.wh.lot_rma_id.id, "location_id": self.output_location.id, "procure_method": "make_to_stock", "route_id": self.customer_route.id, "picking_type_id": self.env.ref("stock.picking_type_internal").id, + "group_propagation_option": "propagate", } ) self.env["stock.rule"].create( @@ -291,7 +294,8 @@ def test_08_cost_from_move_multi_step(self): "location_id": self.customer_location.id, "procure_method": "make_to_order", "route_id": self.customer_route.id, - "picking_type_id": self.env.ref("stock.picking_type_internal").id, + "picking_type_id": self.env.ref("stock.picking_type_out").id, + "group_propagation_option": "propagate", } ) self.env["stock.rule"].create( @@ -303,7 +307,8 @@ def test_08_cost_from_move_multi_step(self): "location_id": self.input_location.id, "procure_method": "make_to_stock", "route_id": self.customer_route.id, - "picking_type_id": self.env.ref("stock.picking_type_internal").id, + "picking_type_id": self.env.ref("stock.picking_type_in").id, + "group_propagation_option": "propagate", } ) self.env["stock.rule"].create( @@ -311,11 +316,12 @@ def test_08_cost_from_move_multi_step(self): "name": "Input->RMA", "action": "pull", "warehouse_id": self.wh.id, - "location_src_id": self.customer_location.id, - "location_id": self.env.ref("rma.location_rma").id, + "location_src_id": self.input_location.id, + "location_id": self.wh.lot_rma_id.id, "procure_method": "make_to_order", "route_id": self.customer_route.id, - "picking_type_id": self.env.ref("stock.picking_type_in").id, + "picking_type_id": self.env.ref("stock.picking_type_internal").id, + "group_propagation_option": "propagate", } ) # Set a standard price on the products