Commit 0bae9056 authored by Łukasz Nowak's avatar Łukasz Nowak

Avoid needless and undesired modification of HS periodicity.

parent 352c3e6b
......@@ -93,27 +93,28 @@ for start_date_tuple in start_date_tuple_list:\n
start_date = getClosestDate(target_date=start_date_tuple[1], precision=\'day\')\n
while start_date.day() >= 29:\n
start_date = addToDate(start_date, to_add={\'day\': -1})\n
start_date_modified = False\n
if start_date_tuple[0] in hosting_subscription_mapping:\n
line_id = hosting_subscription_mapping[start_date_tuple[0]]\n
line = previous_open_sale_order[line_id]\n
if line.getStartDate() is None:\n
modify_kw_kw[line.getAggregate(portal_type=\'Hosting Subscription\')] = {\'start_date\': start_date}\n
modify_kw_kw[line.getAggregate(portal_type=\'Hosting Subscription\')][\'explanation\'] = [\'Set start date because of %s\' % explanation]\n
else:\n
# reset start_date to possibly already set up on Open Order Line\n
start_date = line.getStartDate()\n
start_date_modified = True\n
elif start_date_tuple[0] in add_kw_kw:\n
add_kw_kw[start_date_tuple[0]][\'start_date\'] = start_date\n
add_kw_kw[start_date_tuple[0]][\'explanation\'].append(\'Added start date beacuse of %s\' % explanation)\n
hs = portal.restrictedTraverse(start_date_tuple[0])\n
if hs.getPeriodicityMonthDayList() != [start_date.day()]:\n
hs_modify_kw_kw.setdefault(start_date_tuple[0], {})\n
hs_modify_kw_kw[start_date_tuple[0]] = dict(\n
periodicity_month_day_list = [start_date.day()],\n
periodicity_hour_list=[0],\n
periodicity_minute_list=[0]\n
)\n
hs_modify_kw_kw[start_date_tuple[0]][\'explanation\'] = \'Set up because of %s\' % explanation\n
start_date_modified = True\n
if start_date_modified:\n
hs = portal.restrictedTraverse(start_date_tuple[0])\n
if hs.getPeriodicityMonthDayList() != [start_date.day()]:\n
hs_modify_kw_kw.setdefault(start_date_tuple[0], {})\n
hs_modify_kw_kw[start_date_tuple[0]] = dict(\n
periodicity_month_day_list = [start_date.day()],\n
periodicity_hour_list=[0],\n
periodicity_minute_list=[0]\n
)\n
hs_modify_kw_kw[start_date_tuple[0]][\'explanation\'] = \'Set up because of %s\' % explanation\n
\n
if previous_open_sale_order is not None:\n
for line in previous_open_sale_order.contentValues(portal_type=\'Open Sale Order Line\'):\n
......
686
\ No newline at end of file
687
\ 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