Commit 4a5051de authored by Łukasz Nowak's avatar Łukasz Nowak

Stabilise stop_date setting.

parent bc49a68e
...@@ -122,7 +122,12 @@ else:\n ...@@ -122,7 +122,12 @@ else:\n
order = previous_open_sale_order or open_sale_order\n order = previous_open_sale_order or open_sale_order\n
need_update = False\n need_update = False\n
for line in order.contentValues(portal_type=\'Open Sale Order Line\'):\n for line in order.contentValues(portal_type=\'Open Sale Order Line\'):\n
if line.getStopDate() is not None and line.getStopDate() < next_month:\n old_stop_date = line.getStopDate()\n
if old_stop_date is not None:\n
new_stop_date = stop_date\n
if new_stop_date is None:\n
new_stop_date = old_stop_date + getNumberOfDayInMonth(old_stop_date)\n
if new_stop_date < next_month:\n
need_update = True\n need_update = True\n
break\n break\n
\n \n
...@@ -131,11 +136,11 @@ if need_update:\n ...@@ -131,11 +136,11 @@ if need_update:\n
open_sale_order = previous_open_sale_order.Base_createCloneDocument(batch_mode=1)\n open_sale_order = previous_open_sale_order.Base_createCloneDocument(batch_mode=1)\n
for line in open_sale_order.contentValues(portal_type=\'Open Sale Order Line\'):\n for line in open_sale_order.contentValues(portal_type=\'Open Sale Order Line\'):\n
old_stop_date = line.getStopDate()\n old_stop_date = line.getStopDate()\n
if old_stop_date is not None and old_stop_date < next_month:\n if old_stop_date is not None:\n
if stop_date is not None:\n
new_stop_date = stop_date\n new_stop_date = stop_date\n
else:\n if new_stop_date is None:\n
new_stop_date = old_stop_date + getNumberOfDayInMonth(old_stop_date) \n new_stop_date = old_stop_date + getNumberOfDayInMonth(old_stop_date)\n
if new_stop_date < next_month:\n
line.setStopDate(new_stop_date, activate_kw=activate_kw)\n line.setStopDate(new_stop_date, activate_kw=activate_kw)\n
\n \n
for remove_hosting in remove_hosting_list:\n for remove_hosting in remove_hosting_list:\n
......
634 635
\ 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