Only validate packing for shipments with a shipping service
Closes #14217
This commit is contained in:
1 parent
15f2650954
commit
1de38fedd2
1 file changed
+5
-4
@@ -169,7 +169,7 @@ class ShippingMixin:
|
||||
def validate(cls, shipments):
|
||||
super().validate(shipments)
|
||||
for shipment in shipments:
|
||||
if shipment.carrier and shipment.carrier.shipping_service:
|
||||
if shipment.has_shipping_service:
|
||||
method_name = ('validate_packing_%s'
|
||||
% shipment.carrier.shipping_service)
|
||||
validator = getattr(shipment, method_name)
|
||||
@@ -341,9 +341,10 @@ class CreateShipping(Wizard):
|
||||
start = StateTransition()
|
||||
|
||||
def transition_start(self):
|
||||
shipping_service = self.record.carrier.shipping_service
|
||||
method_name = 'validate_packing_%s' % shipping_service
|
||||
getattr(self.record, method_name)()
|
||||
if self.record.has_shipping_service:
|
||||
shipping_service = self.record.carrier.shipping_service
|
||||
method_name = 'validate_packing_%s' % shipping_service
|
||||
getattr(self.record, method_name)()
|
||||
return 'end'
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user