Commit 97d7ec60 authored by Jérome Perrin's avatar Jérome Perrin

JSComponentGantt: add order in the hierarchy

parent 8f180faa
...@@ -37,12 +37,27 @@ class JSComponentGantt(plugin.OutputPreparationPlugin, TimeSupportMixin): ...@@ -37,12 +37,27 @@ class JSComponentGantt(plugin.OutputPreparationPlugin, TimeSupportMixin):
for element in resultElements: for element in resultElements:
if element['_class'] in self.COMPONENT_CLASS_SET: if element['_class'] in self.COMPONENT_CLASS_SET:
componentId=element['id'] componentId=element['id']
order_id = "bug_order_not_found"
# add the order
for order in data['input']['BOM']['productionOrders']:
for component in order.get('componentsList', []):
if component['id'] == componentId:
order_id = order['id']
if order_id not in task_dict:
task_dict[order_id] = dict(
id=order_id,
text=order.get('name', order_id),
type='project',
open=True)
break
# add the component in the task_dict # add the component in the task_dict
task_dict[element['id']] = dict( task_dict[element['id']] = dict(
id=componentId, id=componentId,
text=componentId, text=componentId,
type='component', type='project',
open=False) open=False,
parent=order_id)
k=1 k=1
......
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