From 63b0f00a83ed1f8d69a64284abf97a8f21f0fa4a Mon Sep 17 00:00:00 2001 From: Thierry Ducrest Date: Fri, 13 Oct 2023 13:26:49 +0200 Subject: [PATCH] sf_spt_force_package: fix after change on depending module --- .../services/single_product_transfer.py | 5 +---- .../tests/test_force_package.py | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/shopfloor_single_product_transfer_force_package/services/single_product_transfer.py b/shopfloor_single_product_transfer_force_package/services/single_product_transfer.py index 2b4a364ed0..6606b612c3 100644 --- a/shopfloor_single_product_transfer_force_package/services/single_product_transfer.py +++ b/shopfloor_single_product_transfer_force_package/services/single_product_transfer.py @@ -11,10 +11,7 @@ class ShopfloorSingleProductTransfer(Component): def _set_quantity__check_location(self, move_line, location, confirmation=False): # We add an additional check to verify if the location requires packages # and return a message to the user accordingly. - if ( - location.package_restriction != "norestriction" - and not move_line.result_package_id - ): + if location.package_restriction and not move_line.result_package_id: message = self.msg_store.location_requires_package() return self._response_for_set_quantity( move_line, message=message, asking_confirmation=None diff --git a/shopfloor_single_product_transfer_force_package/tests/test_force_package.py b/shopfloor_single_product_transfer_force_package/tests/test_force_package.py index cf1f704488..8b0c816daf 100644 --- a/shopfloor_single_product_transfer_force_package/tests/test_force_package.py +++ b/shopfloor_single_product_transfer_force_package/tests/test_force_package.py @@ -64,7 +64,7 @@ def test_force_package_mandatory_with_package(self): def test_force_package_not_mandatory(self): picking = self._setup_picking() move_line = picking.move_line_ids - self.dispatch_location.sudo().package_restriction = "norestriction" + self.dispatch_location.sudo().package_restriction = "" response = self.service.dispatch( "set_quantity", params={