Skip to content

Commit a3b0d3c

Browse files
Merge pull request #178 from akretion/geodis-edi-volume-if-set
[IMP] Geodis : add possibility to add the volume in the EDI file
2 parents 623289c + 139e2ef commit a3b0d3c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

roulier/carriers/geodis_fr/edi/api.py

+6
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ def _parcel(self):
7070
"required": True,
7171
"coerce": "accents",
7272
},
73+
"volume": {
74+
"type": "float",
75+
"required": False,
76+
"empty": True,
77+
"default": 0,
78+
},
7379
}
7480

7581
def _to_address(self):

roulier/carriers/geodis_fr/edi/encoder.py

+4
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ def encode_shipment(self, shipment, service, idx):
6363
lines += [
6464
["GID", "%s" % j, ["1", "PC", "21", "6"]],
6565
["MEA", "AAE", "AAD", ["KGM", "%s" % pack["weight"]]],
66+
]
67+
if pack.get("volume"):
68+
lines.append(["MEA", "AAE", "AAW", ["MTQ", "%s" % pack["volume"]]])
69+
lines += [
6670
["PCI", "18"],
6771
["GIN", "BN", pack["barcode"]],
6872
]

0 commit comments

Comments
 (0)