Importing stock locations correct CSV format. #9245
Replies: 3 comments 6 replies
-
From examining the code I believe a pk must be an integer. I changed the CSV accordingly. The first three lines are now:
This still produces an error at the third line but now it is: Shouldn't 101000000 have been created by the second line? Is this a bug? |
Beta Was this translation helpful? Give feedback.
-
"Parent" should be the ID of the parent location - so an integer number which is unique to the database. |
Beta Was this translation helpful? Give feedback.
-
Here's a gist for the script I wrote to MASS import stock locations and part categories into Inventree. This is first pass so comments appreciated. I used a virtual environment created using vscode to develop and test. The Inventree Python API made it possible to condense the problem into not very many lines. https://gist.github.com/StevenIsaacs/77ed1ca5542cae919d94361f83988ad5 I tested this on my own instance of Inventree. The Thanks for everyone's hard work which made it relatively easy for me to implement this. |
Beta Was this translation helpful? Give feedback.
-
I have a CSV to define stock locations but am encountering an error when attempting to import. I need help understanding what the correct format for the CSV should be in this case.
parent: Incorrect type. Expected pk value, received str
This confuses me because a CSV only contains strings. Here are the first three lines of the CSV. The error occurs on the third line and all lines following it.
Version info:
Thanks
Beta Was this translation helpful? Give feedback.
All reactions