Commit bf074329 authored by Łukasz Nowak's avatar Łukasz Nowak

Set start date of Open Line to moment of instance delivery.

parent 5b375ac8
......@@ -100,15 +100,21 @@ for order in catalog(\n
)\n
add_kw_list.append(add_kw)\n
\n
def getWorkflowDate(delivery, state):\n
workflow_item_list = portal.portal_workflow.getInfoFor(ob=delivery, name=\'history\', wf_id=\'packing_list_workflow\')\n
for item in workflow_item_list:\n
if item.get(\'simulation_state\') == state:\n
return item.get(\'time\')\n
return None\n
\n
for setup_line in catalog(\n
portal_type=\'Sale Packing List Line\',\n
default_resource_uid=setup_resource_uid,\n
simulation_state=[\'stopped\', \'delivered\'],\n
**{\'movement.destination_uid\': person_uid}\n
# **kw\n
):\n
# start date shall be stopped state reach\n
start_date = setup_line.getCreationDate()\n
start_date = getWorkflowDate(setup_line.getParentValue(), \'stopped\')\n
start_date_tuple_list.append((setup_line.getAggregate(portal_type=\'Hosting Subscription\'), start_date))\n
\n
person.Person_updateOpenOrder(remove_hosting_list=remove_hosting_list, add_kw_list=add_kw_list, start_date_tuple_list=start_date_tuple_list, stop_date=stop_date)\n
......
627
\ No newline at end of file
628
\ No newline at end of file
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