diff --git a/migratePKCategories.py b/migratePKCategories.py index e246afb..01e1014 100644 --- a/migratePKCategories.py +++ b/migratePKCategories.py @@ -91,7 +91,10 @@ def getorCreateLocation(part): for loc in itloca: if (loc.name == part.storageLocation): return loc - return 0 + return StockLocation.create(api, { + 'name': part.storageLocation, + 'parent': "" + }) else: #create or return unknownloadtion @@ -107,6 +110,7 @@ def createITPart(part,ITCat): np = Part.create(api, { 'name' : part.name, 'description' : part.description, + 'notes' : part.comment, 'category' : ITCat.pk, 'active' : True, 'virtual' : False, diff --git a/partkeepr.py b/partkeepr.py index 107a0f4..043fb9a 100644 --- a/partkeepr.py +++ b/partkeepr.py @@ -15,6 +15,7 @@ def __init__(self,req): #print (req["name"]) self.name = req["name"] self.description = req["description"] + self.comment = req["comment"] self.id = req["@id"][req["@id"].rfind("/")+1:] try: self.footprint = req["footprint"]["name"]