From e4caee7570b1dc6ccb213fc753caa5b7ab7215b5 Mon Sep 17 00:00:00 2001 From: Andreas Osim Date: Wed, 18 Jul 2018 16:31:10 +0200 Subject: [PATCH] add more carriers to TZCarrier --- .../models/TZCarrier.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ext/custom-addons/tz_carrier_allow_tracking_modification/models/TZCarrier.py b/ext/custom-addons/tz_carrier_allow_tracking_modification/models/TZCarrier.py index f9d99747..7720b0c8 100644 --- a/ext/custom-addons/tz_carrier_allow_tracking_modification/models/TZCarrier.py +++ b/ext/custom-addons/tz_carrier_allow_tracking_modification/models/TZCarrier.py @@ -52,12 +52,19 @@ class TZCarrier(models.Model): def TZCarrier_get_tracking_link(self, picking): + + lSearch = picking.carrier_tracking_ref + if self.name == 'Weiss': if picking.carrier_tracking_ref == '?': lSearch = picking.origin - else: - lSearch = picking.carrier_tracking_ref - TZLink = r'http://isis.gw-world.com/siprod/sixWeb.pStartApp?i_vcAction=SearchConLight&i_vcSearchKey='+lSearch+'&i_vcAdd=Glaser&i_vclangid=DE' + TZLink = r'http://isis.gw-world.com/siprod/sixWeb.pStartApp?i_vcAction=SearchConLight&i_vcSearchKey=%s&i_vcAdd=Glaser&i_vclangid=DE' % lSearch + elif self.name == 'DHL': + TZLink = r'https://www.dhl.at/en/express/tracking.html?AWB=%s&brand=DHL' % lSearch + elif self.name == 'Dachser': + TZLink = r'http://partner.dachser.com/shp2/?wicket:interface=:5:pnlHead:frmHead:btnSearch::IActivePageBehaviorListener:0:-1&wicket:ignoreIfNotActive=true&random=0.35369399622175934&tfiSearch=%s' % lSearch + elif self.name == 'DPD': + TZLink = r'https://tracking.dpd.de/status/de_AT/parcel/%s' % lSearch else: TZLink = False return TZLink