From 925f22771b67c0823bd4579952238499da3bb235 Mon Sep 17 00:00:00 2001 From: Florian da Costa Date: Wed, 3 Apr 2024 15:30:15 +0200 Subject: [PATCH] [FIX] Use expedition number (BarcodeId) as tracking ref since barcode number does not work --- roulier/carriers/dpd_fr_soap/decoder.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/roulier/carriers/dpd_fr_soap/decoder.py b/roulier/carriers/dpd_fr_soap/decoder.py index 155f135..077ba5f 100755 --- a/roulier/carriers/dpd_fr_soap/decoder.py +++ b/roulier/carriers/dpd_fr_soap/decoder.py @@ -22,12 +22,12 @@ def decode(self, response, input_payload): if is_legacy: shipment = shipments.getchildren()[0] parcel_field = "parcelnumber" - barcode_field = "barcode" + tracking_field = "barcode" else: shipmentbc = shipments.getchildren()[0] shipment = shipmentbc.getchildren()[0] - parcel_field = "BarcodeId" - barcode_field = "BarCode" + parcel_field = "Barcode" + tracking_field = "BarcodeId" annexes = [] for dpdfile in files.getchildren(): @@ -38,7 +38,7 @@ def decode(self, response, input_payload): "reference": self._get_parcel_number(input_payload) or getattr(shipment, parcel_field).text, "tracking": { - "number": getattr(shipment, barcode_field).text, + "number": getattr(shipment, tracking_field).text, "url": "", "partner": "", },