Commit 21c8710e authored by Łukasz Nowak's avatar Łukasz Nowak

Store also removal history.

parent 5d305f69
...@@ -163,8 +163,11 @@ for (key, value) in modify_kw_kw.copy().iteritems():\n ...@@ -163,8 +163,11 @@ for (key, value) in modify_kw_kw.copy().iteritems():\n
remove_id_list = set()\n remove_id_list = set()\n
if previous_open_sale_order is not None:\n if previous_open_sale_order is not None:\n
for (remove_hosting, explanation) in remove_hosting_list:\n for (remove_hosting, explanation) in remove_hosting_list:\n
if remove_hosting in add_kw_kw or remove_hosting in modify_kw_kw:\n if remove_hosting in add_kw_kw:\n
# just added, cannot remove yet\n add_kw_kw[remove_hosting][\'explanation\'].append(\'Not removed because just added\')\n
continue\n
if remove_hosting in modify_kw_kw:\n
modify_kw_kw[remove_hosting][\'explanation\'].append(\'Not removed because just modified\')\n
continue\n continue\n
if remove_hosting in hosting_subscription_mapping:\n if remove_hosting in hosting_subscription_mapping:\n
line = previous_open_sale_order[hosting_subscription_mapping.get(remove_hosting)]\n line = previous_open_sale_order[hosting_subscription_mapping.get(remove_hosting)]\n
...@@ -174,7 +177,7 @@ if previous_open_sale_order is not None:\n ...@@ -174,7 +177,7 @@ if previous_open_sale_order is not None:\n
if order_line.getSimulationState() == \'cancelled\':\n if order_line.getSimulationState() == \'cancelled\':\n
order_line_cancelled = True\n order_line_cancelled = True\n
if order_line_cancelled or (line.getStartDate() is not None and line.getStopDate() is not None and line.getStartDate() < line.getStopDate()):\n if order_line_cancelled or (line.getStartDate() is not None and line.getStopDate() is not None and line.getStartDate() < line.getStopDate()):\n
remove_id_list.add(line.getId())\n remove_id_list.add((line.getId(), \'Removed %s\' % line.getPath()))\n
return add_kw_kw, modify_kw_kw, hs_modify_kw_kw, list(remove_id_list)\n return add_kw_kw, modify_kw_kw, hs_modify_kw_kw, list(remove_id_list)\n
......
...@@ -118,7 +118,10 @@ for hs, kw in modify_kw_kw.iteritems():\n ...@@ -118,7 +118,10 @@ for hs, kw in modify_kw_kw.iteritems():\n
for explanation in explanation_list:\n for explanation in explanation_list:\n
storeWorkflowComment(line, explanation)\n storeWorkflowComment(line, explanation)\n
\n \n
open_sale_order.deleteContent(remove_id_list)\n open_sale_order.deleteContent([q[0] for q in remove_id_list])\n
for explanation in remove_id_list:\n
storeWorkflowComment(open_sale_order, explanation[1])\n
\n
if previous_open_sale_order is not None:\n if previous_open_sale_order is not None:\n
previous_open_sale_order.setExpirationDate(now, activate_kw=activate_kw)\n previous_open_sale_order.setExpirationDate(now, activate_kw=activate_kw)\n
\n \n
......
685 686
\ No newline at end of file \ 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