mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[IMP] stock_delivery_planner: method to collect carriers to make it easier to provide or filter
This commit is contained in:
@@ -197,13 +197,12 @@ def patched_get_shipping_price(self, shipment_info, packages, shipper, ship_from
|
||||
_logger.exception(e)
|
||||
tnt_ready = False
|
||||
tnt_response = '-1'
|
||||
if tnt_ready:
|
||||
if tnt_ready and hasattr(tnt_response, 'TransitResponse') and hasattr(tnt_response.TransitResponse, 'ServiceSummary'):
|
||||
for service in tnt_response.TransitResponse.ServiceSummary:
|
||||
if TNT_CODE_MAP.get(service.Service.Code) == service_type:
|
||||
if TNT_CODE_MAP.get(service.Service.Code) == res['service_code']:
|
||||
if hasattr(service, 'EstimatedArrival') and hasattr(service.EstimatedArrival, 'BusinessDaysInTransit'):
|
||||
res['transit_days'] = int(service.EstimatedArrival.BusinessDaysInTransit)
|
||||
break
|
||||
# use TNT API to
|
||||
result.append(res)
|
||||
else:
|
||||
result = {}
|
||||
|
||||
Reference in New Issue
Block a user