diff options
author | Filipp Lepalaan <f@0x00.co> | 2013-04-08 11:35:21 +0300 |
---|---|---|
committer | Filipp Lepalaan <f@0x00.co> | 2013-04-08 11:35:21 +0300 |
commit | a7ea0d63824cf20a57ffe9243e0f85e8b6b725e2 (patch) | |
tree | 5ef7558558910ef6492716b615540dc2b4bf8128 | |
parent | 9ed1d6c5cb8465aa126e706a81315ebc086909c9 (diff) | |
download | py-gsxws-a7ea0d63824cf20a57ffe9243e0f85e8b6b725e2.tar.gz py-gsxws-a7ea0d63824cf20a57ffe9243e0f85e8b6b725e2.tar.bz2 py-gsxws-a7ea0d63824cf20a57ffe9243e0f85e8b6b725e2.zip |
Save Returns packing list as a file
-rwxr-xr-x | gsxws.py | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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): |