[FIX] delivery: fix bad Exception handling

When get_price() is called during tests, a ValidationError was returned but not catched
correctly due to the unavailability of delivery service.
Because this method is called during the creation of new sale order, it leads to some
operational error (broken cursor).
This commit is contained in:
Laurent Smet
2017-02-24 17:57:36 +01:00
committed by qdp-odoo
parent 961b731da3
commit bf8b359b29
+1 -1
View File
@@ -120,7 +120,7 @@ class DeliveryCarrier(models.Model):
try:
computed_price = self.get_shipping_price_from_so(order)[0]
self.available = True
except UserError as e:
except ValidationError as e:
# No suitable delivery method found, probably configuration error
_logger.info("Carrier %s: %s, not found", self.name, e.name)
computed_price = 0.0