I tried uploading pdfs to stock items with the uploadAttachments method. But this only works for the first item.
When i want to upload more, i get an error code:
Traceback (most recent call last):
File "C:/Users/Stijn/Documents/InvenTreeTest/dupdfs.py", line 81, in
uploadpdfs()
File "C:/Users/Stijn/Documents/InvenTreeTest/dupdfs.py", line 78, in uploadpdfs
lijstje[0].uploadAttachment(currentpath + "/" + str(index), comment="")
File "C:\Users\Stijn\AppData\Roaming\Python\Python37\site-packages\inventree\stock.py", line 79, in uploadAttachment
StockItemAttachment.upload(self._api, filename, comment, **kwargs)
File "C:\Users\Stijn\AppData\Roaming\Python\Python37\site-packages\inventree\base.py", line 224, in upload
if response and response.status_code in [200, 201]:
AttributeError: 'dict' object has no attribute 'status_code'
Dear all,
I tried uploading pdfs to stock items with the uploadAttachments method. But this only works for the first item. When i want to upload more, i get an error code:
Traceback (most recent call last): File "C:/Users/Stijn/Documents/InvenTreeTest/dupdfs.py", line 81, in
uploadpdfs()
File "C:/Users/Stijn/Documents/InvenTreeTest/dupdfs.py", line 78, in uploadpdfs
lijstje[0].uploadAttachment(currentpath + "/" + str(index), comment="")
File "C:\Users\Stijn\AppData\Roaming\Python\Python37\site-packages\inventree\stock.py", line 79, in uploadAttachment
StockItemAttachment.upload(self._api, filename, comment, **kwargs)
File "C:\Users\Stijn\AppData\Roaming\Python\Python37\site-packages\inventree\base.py", line 224, in upload
if response and response.status_code in [200, 201]:
AttributeError: 'dict' object has no attribute 'status_code'
Does anyone have any idea how I could fix this?