Initial commit of delivery_hibou and associated refactoring to sale_planner and delivery_stamps for 11.0

This commit is contained in:
Jared Kipe
2018-09-17 17:25:41 -07:00
parent afbfd6ee0e
commit ec73e04f5f
13 changed files with 516 additions and 93 deletions

View File

@@ -193,6 +193,30 @@ class ProviderStamps(models.Model):
res = res + [(0.0, 0, None)]
return res
def stamps_rate_shipment(self, order):
self.ensure_one()
result = {
'success': False,
'price': 0.0,
'error_message': 'Error Retrieving Response from Stamps.com',
'warning_message': False
}
date_planned = None
if self.env.context.get('date_planned'):
date_planned = self.env.context.get('date_planned')
rate = self.stamps_get_shipping_price_for_plan(order, date_planned)
if rate:
price, transit_time, date_delivered = rate[0]
result.update({
'success': True,
'price': price,
'error_message': False,
'transit_time': transit_time,
'date_delivered': date_delivered,
})
return result
return result
def stamps_send_shipping(self, pickings):
res = []
service = self._get_stamps_service()