From 8da5cfded31b332984eb8d96760d632097dc13ae Mon Sep 17 00:00:00 2001 From: Tran Anh Tuan Date: Wed, 17 Apr 2024 16:28:03 +0700 Subject: [PATCH] [REF] stock_release_channel_shipment_advice_deliver --- .../test_stock_release_channel_deliver.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/stock_release_channel_shipment_advice_deliver/tests/test_stock_release_channel_deliver.py b/stock_release_channel_shipment_advice_deliver/tests/test_stock_release_channel_deliver.py index d06edcc4ac..82b1773b60 100644 --- a/stock_release_channel_shipment_advice_deliver/tests/test_stock_release_channel_deliver.py +++ b/stock_release_channel_shipment_advice_deliver/tests/test_stock_release_channel_deliver.py @@ -1,6 +1,7 @@ # Copyright 2023 ACSONE SA/NV # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo import fields from odoo.exceptions import UserError from odoo.tools import mute_logger @@ -194,3 +195,20 @@ def test_deliver_partial_pick_without_bo(self): ) wizard.with_context(test_queue_job_no_delay=True).action_deliver() self.assertEqual(self.channel.state, "delivered") + + def test_delivering_from_shipment_advice(self): + self.assertEqual(self.channel.state, "locked") + self.pickings.write({"release_channel_id": self.channel.id}) + self._do_internal_pickings() + self.assertTrue(self.channel.is_action_deliver_allowed) + shipment_advice = self.env["shipment.advice"].create( + { + "shipment_type": "outgoing", + "release_channel_id": self.channel.id, + "dock_id": self.channel.dock_id.id, + "arrival_date": fields.Datetime.now(), + } + ) + shipment_advice.action_confirm() + shipment_advice.action_in_progress() + self.assertEqual(self.channel.state, "delivering")