aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@0x00.co>2013-04-08 11:35:21 +0300
committerFilipp Lepalaan <f@0x00.co>2013-04-08 11:35:21 +0300
commita7ea0d63824cf20a57ffe9243e0f85e8b6b725e2 (patch)
tree5ef7558558910ef6492716b615540dc2b4bf8128
parent9ed1d6c5cb8465aa126e706a81315ebc086909c9 (diff)
downloadpy-gsxws-a7ea0d63824cf20a57ffe9243e0f85e8b6b725e2.tar.gz
py-gsxws-a7ea0d63824cf20a57ffe9243e0f85e8b6b725e2.tar.bz2
py-gsxws-a7ea0d63824cf20a57ffe9243e0f85e8b6b725e2.zip
Save Returns packing list as a file
-rwxr-xr-xgsxws.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/gsxws.py b/gsxws.py
index 9d4054b..ccc0f18 100755
--- a/gsxws.py
+++ b/gsxws.py
@@ -607,8 +607,16 @@ class Returns(GsxObject):
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)
- return self.submit('RegisterPartsForBulkReturn', dt, 'bulkPartsRegistrationData')
+ result.packingList = of.name
+
+ return result
class Part(GsxObject):
def lookup(self):