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
This commit is contained in:
Cédric Krier committed 2020-04-28 00:32:33 +02:00
1 parent b69acbca12
commit 141074c7b7
1 file changed
+5
+5
View File
@@ -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'