ReadJSWIP plugin corrected

parent e7092d86
...@@ -5,7 +5,6 @@ import random ...@@ -5,7 +5,6 @@ import random
import operator import operator
from datetime import datetime from datetime import datetime
import copy import copy
import routeQuery
from dream.plugins import plugin from dream.plugins import plugin
...@@ -17,8 +16,15 @@ class ReadJSWIP(plugin.InputPreparationPlugin): ...@@ -17,8 +16,15 @@ class ReadJSWIP(plugin.InputPreparationPlugin):
def preprocess(self, data): def preprocess(self, data):
""" inserts the wip as introduced in the GUI to the BOM """ inserts the wip as introduced in the GUI to the BOM
""" """
WIPdata = data["input"]["wip_spreadsheet"] WIPdata = data["input"].get("wip_spreadsheet",[])
wip = data["input"]["BOM"]["WIP"] try:
BOM = data["input"]["BOM"]
except:
BOM = data["input"]["BOM"]={}
try:
wip = BOM["WIP"]
except:
wip = BOM["WIP"] = {}
if WIPdata: if WIPdata:
WIPdata.pop(0) # pop the column names WIPdata.pop(0) # pop the column names
for WIPitem in WIPdata: for WIPitem in WIPdata:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment