make sure tracking number is always set, even if there is none

Depending on the product used, there is no tracking number.  However,
the odoo shipping infrastructure expects us to return one.

Also, add a bogus space at the beginning of the tracking number, as odoo
shipping infrastructure removes the first character ?!?
for/master
Harald Welte 7 years ago
parent 0b16804bcb
commit 77f0962743

@ -89,10 +89,13 @@ class DPDeliveryCarrier(models.Model):
r = im.checkoutPNG()
voucher = r.shoppingCart.voucherList.voucher[0]
filename = 'DP'+voucher.trackId+'.png'
result = { 'exact_price': im.compute_total(),
tracking_nr = ' '
if voucher.trackId:
tracking_nr += voucher.trackId
result = { 'exact_price': im.compute_total()/100,
'weight': service.weight,
'date_delivery': None,
'tracking_number': voucher.trackId,
'tracking_number': tracking_nr,
'voucher_id' : voucher.voucherId,
'order_id' : r.shoppingCart.shopOrderId,
'wallet_balance': r.walletBalance,

Loading…
Cancel
Save