From 141074c7b71c50b25f02479faee92d2d0ae2965a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 28 Apr 2020 00:32:33 +0200 Subject: [PATCH] Validate shipment before create shipping This ensure the shipment is still valid to create shipping for the carrier. Otherwise it raises a nice error message. issue9072 review303421002 --- stock.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stock.py b/stock.py index 2c940f4d06..a99fc54b29 100644 --- a/stock.py +++ b/stock.py @@ -204,4 +204,9 @@ class CreateShipping(Wizard): start = StateTransition() def transition_start(self): + pool = Pool() + ShipmentOut = pool.get('stock.shipment.out') + shipment = ShipmentOut(Transaction().context['active_id']) + method_name = 'validate_packing_%' % shipment.carrier.shipping_service + getattr(shipment, method_name)() return 'end'