From 79bc915381e981836d1807b5e1081324b2a09e4a Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Mon, 20 May 2013 16:21:46 +0300 Subject: Fixing bulk returns --- gsxws/returns.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'gsxws') diff --git a/gsxws/returns.py b/gsxws/returns.py index 42c002f..977a4cb 100644 --- a/gsxws/returns.py +++ b/gsxws/returns.py @@ -100,18 +100,10 @@ class Return(GsxObject): the registered parts. The API returns the Bulk Return Id with the packing list. """ - dt = self._make_type("ns1:registerPartsForBulkReturnRequestType") - self.data['bulkReturnOrder'] = parts - dt.bulkPartsRegistrationRequest = self.data - - result = self.submit("RegisterPartsForBulkReturn", dt, "bulkPartsRegistrationData") - - pdf = base64.b64decode(result.packingList) - of = tempfile.NamedTemporaryFile(suffix=".pdf", delete=False) - of.write(pdf) - result.packingList = of.name - - return result + self.bulkReturnOrder = parts + self._submit("RegisterPartsForBulkReturnRequest", "RegisterPartsForBulkReturn", + "bulkPartsRegistrationData") + return self._req.objects[0] def update_parts(self, confirmation, parts): """ -- cgit v1.2.3