Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
slapos.core
Commits
675cab94
Commit
675cab94
authored
May 29, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate HS w/o periodicity.
parent
737a4d06
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
3 deletions
+25
-3
master/bt5/vifib_upgrader/SkinTemplateItem/portal_skins/vifib_upgrader/SlapDocument_migrateSlapState.xml
...al_skins/vifib_upgrader/SlapDocument_migrateSlapState.xml
+24
-2
master/bt5/vifib_upgrader/bt/revision
master/bt5/vifib_upgrader/bt/revision
+1
-1
No files found.
master/bt5/vifib_upgrader/SkinTemplateItem/portal_skins/vifib_upgrader/SlapDocument_migrateSlapState.xml
View file @
675cab94
...
...
@@ -50,7 +50,24 @@
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n
<value>
<string
encoding=
"cdata"
>
<![CDATA[
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n
\n
def setUpPeriodicity(hosting_subscription):\n
from Products.ERP5Type.DateUtils import addToDate, getClosestDate\n
start_date = hosting_subscription.getCreationDate()\n
start_date = getClosestDate(target_date=start_date, precision=\'day\')\n
while start_date.day() >
= 29:\n
start_date = addToDate(start_date, to_add={\'day\': -1})\n
periodicity_month_day_list = [start_date.day()]\n
periodicity_hour_list=[0]\n
periodicity_minute_list=[0]\n
hosting_subscription.edit(\n
periodicity_month_day_list=periodicity_month_day_list,\n
periodicity_hour_list=periodicity_hour_list,\n
periodicity_minute_list=periodicity_minute_list\n
)\n
\n
slap_document = context\n
portal = context.getPortalObject()\n
...
...
@@ -64,6 +81,9 @@ sale_order_line = slap_document.getAggregateRelatedValue(portal_type=\'Sale Orde
\n
\n
if portal_type == \'Hosting Subscription\':\n
current_periodicity = slap_document.getPeriodicityMonthDayList()\n
if current_periodicity is None or len(current_periodicity) == 0:\n
setUpPeriodicity(slap_document)\n
# Person is now directly associated on the HS\n
slap_document.edit(\n
destination_section_value=sale_order_line.getDestinationSectionValue(portal_type="Person"),\n
...
...
@@ -167,7 +187,9 @@ else:\n
slap_document.invalidate()\n
else:\n
assert(slap_document.getValidationState() == \'validated\')\n
</string>
</value>
]]>
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
...
...
master/bt5/vifib_upgrader/bt/revision
View file @
675cab94
86
\ No newline at end of file
87
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment