Skip to content

Commit

Permalink
[FIX] Use expedition number (BarcodeId) as tracking ref since barcode…
Browse files Browse the repository at this point in the history
… number does not work
  • Loading branch information
florian-dacosta committed Apr 17, 2024
1 parent 156df98 commit 81a564b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions roulier/carriers/dpd_fr_soap/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -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": "",
},
Expand Down

0 comments on commit 81a564b

Please sign in to comment.